Gentoo Archives: gentoo-portage-dev

From: Mike Frysinger <vapier@g.o>
To: gentoo-portage-dev@l.g.o
Cc: Sebastian Luther <SebastianLuther@×××.de>
Subject: [gentoo-portage-dev] [PATCH v2] QA warning for files in /var/{cache,lock,run}/ or /run/
Date: Wed, 11 Dec 2013 07:58:05
Message-Id: 1386748685-12472-1-git-send-email-vapier@gentoo.org
In Reply to: [gentoo-portage-dev] [PATCH] QA warning for files in /var/{cache,lib,lock,run}/ or /run/ (bug 493154) by SebastianLuther@gmx.de
1 From: Sebastian Luther <SebastianLuther@×××.de>
2
3 No warning will be issued if the directories are created, but are
4 left empty.
5
6 URL: https://bugs.gentoo.org/493154
7 ---
8 bin/misc-functions.sh | 19 ++++++++++++++++++-
9 1 file changed, 18 insertions(+), 1 deletion(-)
10
11 diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh
12 index bd99def..2c4d248 100755
13 --- a/bin/misc-functions.sh
14 +++ b/bin/misc-functions.sh
15 @@ -241,13 +241,30 @@ install_qa_check() {
16 for x in etc/app-defaults usr/man usr/info usr/X11R6 usr/doc usr/locale ; do
17 [[ -d ${ED}/$x ]] && f+=" $x\n"
18 done
19 -
20 if [[ -n $f ]] ; then
21 eqawarn "QA Notice: This ebuild installs into the following deprecated directories:"
22 eqawarn
23 eqawarn "$f"
24 fi
25
26 + # It's ok create these directories, but not to install into them. #493154
27 + # TODO: We should add var/lib to this list.
28 + f=
29 + for x in var/cache var/lock var/run run ; do
30 + if [[ ! -L ${ED}/${x} && -d ${ED}/${x} ]] ; then
31 + if [[ -z $(find "${ED}/${x}" -prune -empty) ]] ; then
32 + f+=$(cd "${ED}"; find "${x}" -printf ' %p\n')
33 + fi
34 + fi
35 + done
36 + if [[ -n ${f} ]] ; then
37 + eqawarn "QA Notice: This ebuild installs into paths that should be created at runtime."
38 + eqawarn " To fix, simply do not install into these directories. Instead, your package"
39 + eqawarn " should create dirs on the fly at runtime as needed via init scripts/etc..."
40 + eqawarn
41 + eqawarn "${f}"
42 + fi
43 +
44 set +f
45 f=
46 for x in "${ED}etc/udev/rules.d/"* "${ED}lib"*"/udev/rules.d/"* ; do
47 --
48 1.8.4.3