Skip to content

Commit d123ab3

Browse files
committed
Remove absolute pathnames to binaries and rely on PATH
Fixes issues with distributions that use non-standard binary paths (e.g., in isolated build environments). Scripts rely on PATH for other programs, anyway.
1 parent b08b5ef commit d123ab3

File tree

5 files changed

+9
-9
lines changed

5 files changed

+9
-9
lines changed

do

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ usage() {
2424
}
2525

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

2929
args=
3030
while [ "$1" != "${1#-}" ]; do

minimal/do.test

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,9 +136,9 @@ mkdir y
136136
ln -s . y/x
137137
check "/usr/__does_not/b" _realpath "/usr/__does_not/a/../b" "$x"
138138
check "foo" _realpath "y/x/x/x/x/x/../foo" "$PWD"
139-
check "$(/bin/pwd)/foo" _realpath "$PWD/y/x/x/x/x/x/../foo" "$PWD"
139+
check "$(pwd)/foo" _realpath "$PWD/y/x/x/x/x/x/../foo" "$PWD"
140140
check "foo/blam" _realpath "y/x/x/x/x/x/../foo/spam/../blam" "$PWD"
141-
check "$(/bin/pwd)/foo/blam" _realpath "$PWD/y/x/x/../foo/spam/../blam" "$PWD"
141+
check "$(pwd)/foo/blam" _realpath "$PWD/y/x/x/../foo/spam/../blam" "$PWD"
142142

143143

144144
SECTION _find_dofile

t/105-sympath/all.do

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ for iter in 10 20; do
1414
cd y/x/x/x/x/x
1515
IFS=$(printf '\n')
1616
redo-ifchange static x/x/x/static $PWD/static \
17-
$(/bin/pwd)/static /etc/passwd
17+
$(pwd)/static /etc/passwd
1818
redo-ifchange $PWD/../static 2>/dev/null && exit 35
1919
redo-ifchange 1.dyn x/x/x/2.dyn $PWD/3.dyn \
20-
$PWD/../4.dyn $(/bin/pwd)/5.dyn
20+
$PWD/../4.dyn $(pwd)/5.dyn
2121
)
2222
[ -e y/1.dyn ] || exit $((iter + 1))
2323
[ -e y/2.dyn ] || exit $((iter + 2))

t/all.do

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ fi
1010

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

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

@@ -25,7 +25,7 @@ xargs redo
2525
# are checking for unnecessary extra rebuilds of some targets, which
2626
# might happen after flush-cache.
2727
# FIXME: a better solution might be to make flush-cache less destructive!
28-
/bin/ls [s][0-9][0-9]*/all.do |
28+
ls [s][0-9][0-9]*/all.do |
2929
sed 's/\.do$//' | {
3030
while read d; do
3131
redo "$d"

t/clean.do

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/bin/ls [0-9s][0-9][0-9]*/clean.do |
1+
ls [0-9s][0-9][0-9]*/clean.do |
22
sed 's/\.do$//' |
33
xargs redo
44

0 commit comments

Comments
 (0)