Re: [gentoo-portage-dev] [PATCH] *-qa-check.d: fix entering EROOT in EAPI 7

2018-10-25 Thread Zac Medico
On 10/25/2018 07:25 AM, Michał Górny wrote:
> Fix running QA checks from EROOT in EAPI 7 if the value is empty.
> Previously, this wrongly caused 'cd' to be run with empty value implying
> home directory.
> 
> Bug: https://bugs.gentoo.org/668638
> Signed-off-by: Michał Górny 
> ---
>  bin/misc-functions.sh  | 2 +-
>  bin/postinst-qa-check.d/50gnome2-utils | 2 +-
>  bin/postinst-qa-check.d/50xdg-utils| 2 +-
>  3 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh
> index 8c88f8f35..ff3d2a1ff 100755
> --- a/bin/misc-functions.sh
> +++ b/bin/misc-functions.sh
> @@ -174,7 +174,7 @@ postinst_qa_check() {
>   local EPREFIX= EROOT=${ROOT}
>   fi
>  
> - cd "${EROOT}" || die "cd failed"
> + cd "${EROOT:-/}" || die "cd failed"
>  
>   # Collect the paths for QA checks, highest prio first.
>   paths=(
> diff --git a/bin/postinst-qa-check.d/50gnome2-utils 
> b/bin/postinst-qa-check.d/50gnome2-utils
> index a50df009a..29ea7c844 100644
> --- a/bin/postinst-qa-check.d/50gnome2-utils
> +++ b/bin/postinst-qa-check.d/50gnome2-utils
> @@ -54,7 +54,7 @@ gnome2_icon_cache_check() {
>  }
>  
>  gnome2_utils_postinst_check() {
> - cd "${EROOT}" || die
> + cd "${EROOT:-/}" || die
>   gnome2_icon_cache_check
>  }
>  
> diff --git a/bin/postinst-qa-check.d/50xdg-utils 
> b/bin/postinst-qa-check.d/50xdg-utils
> index 7094e75a1..b33df4743 100644
> --- a/bin/postinst-qa-check.d/50xdg-utils
> +++ b/bin/postinst-qa-check.d/50xdg-utils
> @@ -90,7 +90,7 @@ xdg_mimeinfo_database_check() {
>  }
>  
>  xdg_utils_postinst_check() {
> - cd "${EROOT}" || die
> + cd "${EROOT:-/}" || die
>   xdg_desktop_database_check
>   xdg_mimeinfo_database_check
>  }
> 

Looks good, please merge.
-- 
Thanks,
Zac



signature.asc
Description: OpenPGP digital signature


[gentoo-portage-dev] [PATCH] *-qa-check.d: fix entering EROOT in EAPI 7

2018-10-25 Thread Michał Górny
Fix running QA checks from EROOT in EAPI 7 if the value is empty.
Previously, this wrongly caused 'cd' to be run with empty value implying
home directory.

Bug: https://bugs.gentoo.org/668638
Signed-off-by: Michał Górny 
---
 bin/misc-functions.sh  | 2 +-
 bin/postinst-qa-check.d/50gnome2-utils | 2 +-
 bin/postinst-qa-check.d/50xdg-utils| 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh
index 8c88f8f35..ff3d2a1ff 100755
--- a/bin/misc-functions.sh
+++ b/bin/misc-functions.sh
@@ -174,7 +174,7 @@ postinst_qa_check() {
local EPREFIX= EROOT=${ROOT}
fi
 
-   cd "${EROOT}" || die "cd failed"
+   cd "${EROOT:-/}" || die "cd failed"
 
# Collect the paths for QA checks, highest prio first.
paths=(
diff --git a/bin/postinst-qa-check.d/50gnome2-utils 
b/bin/postinst-qa-check.d/50gnome2-utils
index a50df009a..29ea7c844 100644
--- a/bin/postinst-qa-check.d/50gnome2-utils
+++ b/bin/postinst-qa-check.d/50gnome2-utils
@@ -54,7 +54,7 @@ gnome2_icon_cache_check() {
 }
 
 gnome2_utils_postinst_check() {
-   cd "${EROOT}" || die
+   cd "${EROOT:-/}" || die
gnome2_icon_cache_check
 }
 
diff --git a/bin/postinst-qa-check.d/50xdg-utils 
b/bin/postinst-qa-check.d/50xdg-utils
index 7094e75a1..b33df4743 100644
--- a/bin/postinst-qa-check.d/50xdg-utils
+++ b/bin/postinst-qa-check.d/50xdg-utils
@@ -90,7 +90,7 @@ xdg_mimeinfo_database_check() {
 }
 
 xdg_utils_postinst_check() {
-   cd "${EROOT}" || die
+   cd "${EROOT:-/}" || die
xdg_desktop_database_check
xdg_mimeinfo_database_check
 }
-- 
2.19.1