Gentoo Archives: gentoo-portage-dev

From: "Michał Górny" <mgorny@g.o>
To: gentoo-portage-dev@l.g.o
Cc: "Michał Górny" <mgorny@g.o>
Subject: [gentoo-portage-dev] [PATCH] *-qa-check.d: fix entering EROOT in EAPI 7
Date: Thu, 25 Oct 2018 14:25:49
Message-Id: 20181025142538.9978-1-mgorny@gentoo.org
1 Fix running QA checks from EROOT in EAPI 7 if the value is empty.
2 Previously, this wrongly caused 'cd' to be run with empty value implying
3 home directory.
4
5 Bug: https://bugs.gentoo.org/668638
6 Signed-off-by: Michał Górny <mgorny@g.o>
7 ---
8 bin/misc-functions.sh | 2 +-
9 bin/postinst-qa-check.d/50gnome2-utils | 2 +-
10 bin/postinst-qa-check.d/50xdg-utils | 2 +-
11 3 files changed, 3 insertions(+), 3 deletions(-)
12
13 diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh
14 index 8c88f8f35..ff3d2a1ff 100755
15 --- a/bin/misc-functions.sh
16 +++ b/bin/misc-functions.sh
17 @@ -174,7 +174,7 @@ postinst_qa_check() {
18 local EPREFIX= EROOT=${ROOT}
19 fi
20
21 - cd "${EROOT}" || die "cd failed"
22 + cd "${EROOT:-/}" || die "cd failed"
23
24 # Collect the paths for QA checks, highest prio first.
25 paths=(
26 diff --git a/bin/postinst-qa-check.d/50gnome2-utils b/bin/postinst-qa-check.d/50gnome2-utils
27 index a50df009a..29ea7c844 100644
28 --- a/bin/postinst-qa-check.d/50gnome2-utils
29 +++ b/bin/postinst-qa-check.d/50gnome2-utils
30 @@ -54,7 +54,7 @@ gnome2_icon_cache_check() {
31 }
32
33 gnome2_utils_postinst_check() {
34 - cd "${EROOT}" || die
35 + cd "${EROOT:-/}" || die
36 gnome2_icon_cache_check
37 }
38
39 diff --git a/bin/postinst-qa-check.d/50xdg-utils b/bin/postinst-qa-check.d/50xdg-utils
40 index 7094e75a1..b33df4743 100644
41 --- a/bin/postinst-qa-check.d/50xdg-utils
42 +++ b/bin/postinst-qa-check.d/50xdg-utils
43 @@ -90,7 +90,7 @@ xdg_mimeinfo_database_check() {
44 }
45
46 xdg_utils_postinst_check() {
47 - cd "${EROOT}" || die
48 + cd "${EROOT:-/}" || die
49 xdg_desktop_database_check
50 xdg_mimeinfo_database_check
51 }
52 --
53 2.19.1

Replies