[PATCH] phase-helpers.sh: avoid passing an empty root value to portageq

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[PATCH] phase-helpers.sh: avoid passing an empty root value to portageq

Mike Gilbert-2
Bug: https://bugs.gentoo.org/708660
Signed-off-by: Mike Gilbert <[hidden email]>
---
 bin/phase-helpers.sh | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index 020862ba0..3deb28c68 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -878,7 +878,7 @@ ___best_version_and_has_version_common() {
  if ___eapi_has_prefix_variables; then
  case ${root_arg} in
  -r) root=${ROOT%/}/${EPREFIX#/} ;;
- -d) root=${ESYSROOT} ;;
+ -d) root=${ESYSROOT:-/} ;;
  -b)
  # Use /${PORTAGE_OVERRIDE_EPREFIX#/} which is equivalent
  # to BROOT, except BROOT is only defined in src_* phases.
@@ -888,8 +888,8 @@ ___best_version_and_has_version_common() {
  esac
  else
  case ${root_arg} in
- -r) root=${ROOT} ;;
- -d) root=${SYSROOT} ;;
+ -r) root=${ROOT:-/} ;;
+ -d) root=${SYSROOT:-/} ;;
  -b) root=/ ;;
  esac
  fi ;;
--
2.25.0


Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] phase-helpers.sh: avoid passing an empty root value to portageq

Zac Medico-2
On 2/8/20 9:50 AM, Mike Gilbert wrote:

> Bug: https://bugs.gentoo.org/708660
> Signed-off-by: Mike Gilbert <[hidden email]>
> ---
>  bin/phase-helpers.sh | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
> index 020862ba0..3deb28c68 100644
> --- a/bin/phase-helpers.sh
> +++ b/bin/phase-helpers.sh
> @@ -878,7 +878,7 @@ ___best_version_and_has_version_common() {
>   if ___eapi_has_prefix_variables; then
>   case ${root_arg} in
>   -r) root=${ROOT%/}/${EPREFIX#/} ;;
> - -d) root=${ESYSROOT} ;;
> + -d) root=${ESYSROOT:-/} ;;
>   -b)
>   # Use /${PORTAGE_OVERRIDE_EPREFIX#/} which is equivalent
>   # to BROOT, except BROOT is only defined in src_* phases.
> @@ -888,8 +888,8 @@ ___best_version_and_has_version_common() {
>   esac
>   else
>   case ${root_arg} in
> - -r) root=${ROOT} ;;
> - -d) root=${SYSROOT} ;;
> + -r) root=${ROOT:-/} ;;
> + -d) root=${SYSROOT:-/} ;;
>   -b) root=/ ;;
>   esac
>   fi ;;
>
Looks good. Please merge.
--
Thanks,
Zac


signature.asc (1000 bytes) Download Attachment