Skip to content

Commit

Permalink
Remove absolute pathnames to binaries and rely on PATH
Browse files Browse the repository at this point in the history
 Fixes issues with distributions that use non-standard binary paths (e.g., in
 isolated build environments). Scripts rely on PATH for other programs, anyway.
  • Loading branch information
spacefrogg committed Aug 1, 2019
1 parent b08b5ef commit d123ab3
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion do
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ usage() {
}

mydir=$(dirname "$0")
cd "$(/bin/pwd)" && cd "$mydir" || die "can't find self in dir: $mydir"
cd "$(pwd)" && cd "$mydir" || die "can't find self in dir: $mydir"

args=
while [ "$1" != "${1#-}" ]; do
Expand Down
4 changes: 2 additions & 2 deletions minimal/do.test
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,9 @@ mkdir y
ln -s . y/x
check "/usr/__does_not/b" _realpath "/usr/__does_not/a/../b" "$x"
check "foo" _realpath "y/x/x/x/x/x/../foo" "$PWD"
check "$(/bin/pwd)/foo" _realpath "$PWD/y/x/x/x/x/x/../foo" "$PWD"
check "$(pwd)/foo" _realpath "$PWD/y/x/x/x/x/x/../foo" "$PWD"
check "foo/blam" _realpath "y/x/x/x/x/x/../foo/spam/../blam" "$PWD"
check "$(/bin/pwd)/foo/blam" _realpath "$PWD/y/x/x/../foo/spam/../blam" "$PWD"
check "$(pwd)/foo/blam" _realpath "$PWD/y/x/x/../foo/spam/../blam" "$PWD"


SECTION _find_dofile
Expand Down
4 changes: 2 additions & 2 deletions t/105-sympath/all.do
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ for iter in 10 20; do
cd y/x/x/x/x/x
IFS=$(printf '\n')
redo-ifchange static x/x/x/static $PWD/static \
$(/bin/pwd)/static /etc/passwd
$(pwd)/static /etc/passwd
redo-ifchange $PWD/../static 2>/dev/null && exit 35
redo-ifchange 1.dyn x/x/x/2.dyn $PWD/3.dyn \
$PWD/../4.dyn $(/bin/pwd)/5.dyn
$PWD/../4.dyn $(pwd)/5.dyn
)
[ -e y/1.dyn ] || exit $((iter + 1))
[ -e y/2.dyn ] || exit $((iter + 2))
Expand Down
6 changes: 3 additions & 3 deletions t/all.do
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ fi

# builds 1xx*/all to test for basic/dangerous functionality.
# We don't want to run more advanced tests if the basics don't work.
/bin/ls 1[0-9][0-9]*/all.do |
ls 1[0-9][0-9]*/all.do |
sed 's/\.do$//' |
xargs redo
110-compile/hello >&2

# builds most of the rest in parallel
/bin/ls [2-9][0-9][0-9]*/all.do |
ls [2-9][0-9][0-9]*/all.do |
sed 's/\.do$//' |
xargs redo

Expand All @@ -25,7 +25,7 @@ xargs redo
# are checking for unnecessary extra rebuilds of some targets, which
# might happen after flush-cache.
# FIXME: a better solution might be to make flush-cache less destructive!
/bin/ls [s][0-9][0-9]*/all.do |
ls [s][0-9][0-9]*/all.do |
sed 's/\.do$//' | {
while read d; do
redo "$d"
Expand Down
2 changes: 1 addition & 1 deletion t/clean.do
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/bin/ls [0-9s][0-9][0-9]*/clean.do |
ls [0-9s][0-9][0-9]*/clean.do |
sed 's/\.do$//' |
xargs redo

Expand Down

0 comments on commit d123ab3

Please sign in to comment.