Merge lp:~bac/lpsetup/xbit into lp:lpsetup

Proposed by Brad Crittenden
Status: Merged
Approved by: Brad Crittenden
Approved revision: 78
Merged at revision: 78
Proposed branch: lp:~bac/lpsetup/xbit
Merge into: lp:lpsetup
Diff against target: 11 lines (+1/-1)
1 file modified
lpsetup/subcommands/init_target.py (+1/-1)
To merge this branch: bzr merge lp:~bac/lpsetup/xbit
Reviewer Review Type Date Requested Status
Benji York (community) code Approve
Review via email: mp+121259@code.launchpad.net

Commit message

Invoke launchpad-database-setup using /bin/sh to avoid problem with the installer dropping the execution bit.

Description of the change

When lpsetup is installed, the script lpsetup/bin/launchpad-database-setup loses its execution bit when put into the egg which results in a permission error when it is invoked.

It looks like there is a bug in the installer (acknowledged but not fixed). The easiest work-around is to just call it via invoking /bin/sh on the script instead.

To post a comment you must log in.
Revision history for this message
Benji York (benji) wrote :

This is OK, I suppose. It does worry met that if the shebang ever
changes to another shell -- say /bin/bash -- and the script takes
advantage of non-sh features, then this could break in mysterious ways
(and the script when run stand-alone will still work, adding to the
mystery).

I wonder if it is worth reading the first line of the script (at
execution time) to assert that it really should be run with /bin/sh.

review: Approve (code)
Revision history for this message
Brad Crittenden (bac) wrote :

Good point Benji. Rather than do what you suggest long-term, I think it wiser to just figure out how to make setup.py not drop the execute bit. After discussion with you decided to land this branch with the risk you pointed out.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lpsetup/subcommands/init_target.py'
2--- lpsetup/subcommands/init_target.py 2012-08-22 16:48:50 +0000
3+++ lpsetup/subcommands/init_target.py 2012-08-24 18:55:23 +0000
4@@ -269,7 +269,7 @@
5 script_name = 'launchpad-database-setup'
6 here = os.path.dirname(__file__)
7 script_path = os.path.join(here, '..', 'bin', script_name)
8- call(script_path, user)
9+ call('/bin/sh', script_path, user)
10
11 setup_database.description = """Setup database for Launchpad use."""
12

Subscribers

People subscribed via source and target branches