Skip to content

Commit

Permalink
Autodetect echo command location; fixes #47
Browse files Browse the repository at this point in the history
  • Loading branch information
dex4er committed Mar 5, 2019
1 parent ecc637d commit 1f9cf1e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -70,6 +70,7 @@ GTAGS
# Editors
*~
*.orig
.vstags
/.autotools
/.cproject
/.project
Expand Down
11 changes: 9 additions & 2 deletions scripts/fakechroot.sh
Expand Up @@ -79,6 +79,13 @@ if [ "$fakechroot_paths" = "no" ]; then
fakechroot_paths=
fi

if command -v which >/dev/null; then
fakechroot_echo=`which echo`
fakechroot_echo=${fakechroot_echo:-@ECHO@}
else
fakechroot_echo=@ECHO@
fi


# Get options
fakechroot_getopttest=`getopt --version`
Expand Down Expand Up @@ -148,7 +155,7 @@ fi

# Autodetect if dynamic linker supports --argv0 option
if [ -n "$FAKECHROOT_ELFLOADER" ]; then
fakechroot_detect=`$FAKECHROOT_ELFLOADER --argv0 echo @ECHO@ yes 2>&1`
fakechroot_detect=`$FAKECHROOT_ELFLOADER --argv0 echo $fakechroot_echo yes 2>&1`
if [ "$fakechroot_detect" = yes ]; then
FAKECHROOT_ELFLOADER_OPT_ARGV0="--argv0"
export FAKECHROOT_ELFLOADER_OPT_ARGV0
Expand All @@ -160,7 +167,7 @@ fi
fakechroot_paths="$fakechroot_paths${LD_LIBRARY_PATH:+${fakechroot_paths:+:}$LD_LIBRARY_PATH}"
fakechroot_lib="$fakechroot_lib${LD_PRELOAD:+ $LD_PRELOAD}"

fakechroot_detect=`LD_LIBRARY_PATH="$fakechroot_paths" LD_PRELOAD="$fakechroot_lib" FAKECHROOT_DETECT=1 @ECHO@ 2>&1`
fakechroot_detect=`LD_LIBRARY_PATH="$fakechroot_paths" LD_PRELOAD="$fakechroot_lib" FAKECHROOT_DETECT=1 $fakechroot_echo 2>&1`
case "$fakechroot_detect" in
fakechroot*)
fakechroot_libfound=yes
Expand Down

0 comments on commit 1f9cf1e

Please sign in to comment.