summaryrefslogtreecommitdiffstats
path: root/scripts/.aglsetup_genconfig.bash
diff options
context:
space:
mode:
authorHenrique Ferreiro <hferreiro@igalia.com>2018-11-23 01:40:32 +0100
committerJan-Simon Moeller <jsmoeller@linuxfoundation.org>2018-11-23 19:16:16 +0000
commitcae7cfb01c4e39a33ef3e851851632b4f0fd5db4 (patch)
treed34d2c5ef123455d66f640ab5ed18d584984c10d /scripts/.aglsetup_genconfig.bash
parent803f03daebb58b3a26462df35f001637f2ddf9a0 (diff)
Fix SOURCEDIR, BUILDDIR and similar when `cd` prints to stdout
Several variables containing directories in `aglsetup.sh` and other scripts use the common one-liner "cd $DIR && pwd -P" to resolve symlinks. Unfortunately, in some cases, `cd` writes the new directory to stdout, e.g. when using multiple search paths. This commit changes the above to "cd $DIR > /dev/null && pwd -P" to make it more robust. Change-Id: I150ecc9940d88738cf17add68290c35486a81a3b Signed-off-by: Henrique Ferreiro <hferreiro@igalia.com>
Diffstat (limited to 'scripts/.aglsetup_genconfig.bash')
-rwxr-xr-xscripts/.aglsetup_genconfig.bash8
1 files changed, 4 insertions, 4 deletions
diff --git a/scripts/.aglsetup_genconfig.bash b/scripts/.aglsetup_genconfig.bash
index d4f3ba813..b2471a71c 100755
--- a/scripts/.aglsetup_genconfig.bash
+++ b/scripts/.aglsetup_genconfig.bash
@@ -39,8 +39,8 @@ DEBUG=0
#SCRIPT=$(basename $BASH_SOURCE)
SCRIPT=aglsetup.sh
-SCRIPTDIR=$(cd $(dirname $BASH_SOURCE) && pwd -P)
-METADIR=$(cd $(dirname $BASH_SOURCE)/../.. && pwd -P)
+SCRIPTDIR=$(cd $(dirname $BASH_SOURCE) > /dev/null && pwd -P)
+METADIR=$(cd $(dirname $BASH_SOURCE)/../.. > /dev/null && pwd -P)
function info() { echo "$@" >&2; }
function infon() { echo -n "$@" >&2; }
@@ -342,7 +342,7 @@ done
# validate build dir
debug "validating builddir $BUILDDIR"
-BUILDDIR=$(mkdir -p "$BUILDDIR" && cd "$BUILDDIR" && pwd -P)
+BUILDDIR=$(mkdir -p "$BUILDDIR" && cd "$BUILDDIR" > /dev/null && pwd -P)
validate_builddir
###########################################################################################
@@ -359,7 +359,7 @@ function genconfig() {
info " Features: $FEATURES"
# step 1: run usual OE setup to generate conf dir
- export TEMPLATECONF=$(cd $SCRIPTDIR/../templates/base && pwd -P)
+ export TEMPLATECONF=$(cd $SCRIPTDIR/../templates/base > /dev/null && pwd -P)
debug "running oe-init-build-env with TEMPLATECONF=$TEMPLATECONF"
info " Running $METADIR/poky/oe-init-build-env"
info " Templates dir: $TEMPLATECONF"