GNOME Bugzilla – Bug 692825
`make install' fails on Debian systems if called more than once
Last modified: 2013-02-09 11:58:08 UTC
The scripts/debian-python2-postinstall-hook.sh hack to make the 'python2' command available to modules on Debian systems causes `make install' to break since it dies when trying to create the symlink if it exists already.
Created attachment 234774 [details] [review] scripts: Make the ~/.local/bin/python2 idempotent The python2 hack for Debian system causes `make install' to fail if ran more than once, since it tries to create the link even if it exists already. Other than making it idempotent such that it can be run more than once also drop an unused variable, improve the runtime checks and make the coding style more shell-like.
Review of attachment 234774 [details] [review]: One minor comment, otherwise looks fine. ::: scripts/debian-python2-postinstall-hook.sh @@ +20,3 @@ +test -x "$PYTHON" || (echo "$0: Unable to find 'python' in the PATH" >&2; exit 2) + +ln -s "$PYTHON" "$DEST" Might as well change this to "ln -sf".
The following fix has been pushed: 1d3644c scripts: Make the ~/.local/bin/python2 idempotent
Created attachment 235539 [details] [review] scripts: Make the ~/.local/bin/python2 idempotent The python2 hack for Debian system causes `make install' to fail if ran more than once, since it tries to create the link even if it exists already. Other than making it idempotent such that it can be run more than once also drop an unused variable, improve the runtime checks and make the coding style more shell-like.
Commit 1d3644c78eb3b8f4bb384701a7318b5ccb76b9ae does not work for me on Debian sid. During "make install", I get: make[2]: Leaving directory `/home/tom/devel/git/jhbuild/buildbot' make[1]: Leaving directory `/home/tom/devel/git/jhbuild/buildbot' make[1]: Entering directory `/home/tom/devel/git/jhbuild' make[2]: Entering directory `/home/tom/devel/git/jhbuild' /bin/mkdir -p '/home/tom/.local//bin' /usr/bin/install -c install-check '/home/tom/.local//bin' ./scripts/debian-python2-postinstall-hook.sh /home/tom/.local//bin ./scripts/debian-python2-postinstall-hook.sh: 15: ./scripts/debian-python2-postinstall-hook.sh: Syntax error: "(" unexpected make[2]: *** [install-exec-local] Error 2 make[2]: Leaving directory `/home/tom/devel/git/jhbuild' make[1]: *** [install-am] Error 2 make[1]: Leaving directory `/home/tom/devel/git/jhbuild' make: *** [install-recursive] Error 1
Created attachment 235582 [details] [review] scripts: Remove bashism from debian-python2-postinstall-hook.sh Sorry, I didn't notice that bash has been set again as /bin/sh on my system and I inadvertently used the bash 'function' keyword...
Created attachment 235583 [details] [review] remove function bashism don't use the function bashism