After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 692825 - `make install' fails on Debian systems if called more than once
`make install' fails on Debian systems if called more than once
Status: RESOLVED FIXED
Product: jhbuild
Classification: Infrastructure
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Jhbuild maintainers
Jhbuild QA
Depends on:
Blocks:
 
 
Reported: 2013-01-29 18:45 UTC by Emanuele Aina
Modified: 2013-02-09 11:58 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
scripts: Make the ~/.local/bin/python2 idempotent (1.55 KB, patch)
2013-01-29 18:47 UTC, Emanuele Aina
committed Details | Review
scripts: Make the ~/.local/bin/python2 idempotent (1.58 KB, patch)
2013-02-08 20:21 UTC, Emanuele Aina
committed Details | Review
scripts: Remove bashism from debian-python2-postinstall-hook.sh (924 bytes, patch)
2013-02-09 11:53 UTC, Emanuele Aina
committed Details | Review
remove function bashism (968 bytes, patch)
2013-02-09 11:58 UTC, Thomas Bechtold
none Details | Review

Description Emanuele Aina 2013-01-29 18:45:29 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.
Comment 1 Emanuele Aina 2013-01-29 18:47:31 UTC
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.
Comment 2 Colin Walters 2013-01-29 18:57:33 UTC
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".
Comment 3 Emanuele Aina 2013-02-08 20:21:29 UTC
The following fix has been pushed:
1d3644c scripts: Make the ~/.local/bin/python2 idempotent
Comment 4 Emanuele Aina 2013-02-08 20:21:37 UTC
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.
Comment 5 Thomas Bechtold 2013-02-09 11:38:00 UTC
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
Comment 6 Emanuele Aina 2013-02-09 11:53:28 UTC
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...
Comment 7 Thomas Bechtold 2013-02-09 11:58:08 UTC
Created attachment 235583 [details] [review]
remove function bashism

don't use the function bashism