From 167d1f23a54861055dce756ae39c012533a5e7f0 Mon Sep 17 00:00:00 2001 From: Sebastian Luther Date: Thu, 5 Dec 2013 21:57:17 +0100 Subject: [PATCH] QA warning for files in /var/{cache,lock,run}/ or /run/ No warning will be issued if the directories are created, but are left empty. URL: https://bugs.gentoo.org/493154 --- bin/misc-functions.sh | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh index bd99def32..2c4d2489a 100755 --- a/bin/misc-functions.sh +++ b/bin/misc-functions.sh @@ -241,13 +241,30 @@ install_qa_check() { for x in etc/app-defaults usr/man usr/info usr/X11R6 usr/doc usr/locale ; do [[ -d ${ED}/$x ]] && f+=" $x\n" done - if [[ -n $f ]] ; then eqawarn "QA Notice: This ebuild installs into the following deprecated directories:" eqawarn eqawarn "$f" fi + # It's ok create these directories, but not to install into them. #493154 + # TODO: We should add var/lib to this list. + f= + for x in var/cache var/lock var/run run ; do + if [[ ! -L ${ED}/${x} && -d ${ED}/${x} ]] ; then + if [[ -z $(find "${ED}/${x}" -prune -empty) ]] ; then + f+=$(cd "${ED}"; find "${x}" -printf ' %p\n') + fi + fi + done + if [[ -n ${f} ]] ; then + eqawarn "QA Notice: This ebuild installs into paths that should be created at runtime." + eqawarn " To fix, simply do not install into these directories. Instead, your package" + eqawarn " should create dirs on the fly at runtime as needed via init scripts/etc..." + eqawarn + eqawarn "${f}" + fi + set +f f= for x in "${ED}etc/udev/rules.d/"* "${ED}lib"*"/udev/rules.d/"* ; do -- 2.26.2