Skip to content

Commit abc3526

Browse files
committed
docs/Makefile.sh: Fix the attempt to determine what directory
Makefile.sh is in. Checking ${1} resulted in a empty/null value, which was worked around in debian/rules by manually changing to the correct directory, but this only hid the bug. The correct variable to check is ${0}. When run with bash as /bin/sh, changes in behavior with bash 5.3 in handling "cd" with an empty argument revealed the bug by not creating any manpages, and bash emitting an error. This was discovered when ltsp started failing to build reproducibly on tests.reproducible-builds.org, where /bin/sh points to bash in one test. Big thanks to Chris Lamb who identified the issue and the proper fix!
1 parent e3386a0 commit abc3526

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

docs/Makefile.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ main() {
205205
fi
206206
echo "Using $cmd to generate the man pages"
207207

208-
cd "${1%/*}"
208+
cd "${0%/*}"
209209
if is_command dpkg-parsechangelog; then
210210
_VERSION=$(dpkg-parsechangelog -l ../debian/changelog -S VERSION)
211211
else

0 commit comments

Comments
 (0)