Merge lp:~tim-greaves/spud/diamond-setup-py-fix2 into lp:spud

Proposed by Tim Greaves
Status: Merged
Approved by: Patrick Farrell
Approved revision: 514
Merged at revision: 513
Proposed branch: lp:~tim-greaves/spud/diamond-setup-py-fix2
Merge into: lp:spud
Diff against target: 46 lines (+23/-4)
1 file modified
diamond/setup.py.in (+23/-4)
To merge this branch: bzr merge lp:~tim-greaves/spud/diamond-setup-py-fix2
Reviewer Review Type Date Requested Status
Patrick Farrell Approve
Review via email: mp+90878@code.launchpad.net

Description of the change

Suggested completion of the fix that Patrick applied to make the diamond install honour --prefix= supplied at the setup.py install stage as well as the prefix supplied to the initial libspud configure instance.

To post a comment you must log in.
Revision history for this message
Patrick Farrell (pefarrell) wrote :

Does exactly what it says on the tin.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'diamond/setup.py.in'
2--- diamond/setup.py.in 2011-07-12 11:24:31 +0000
3+++ diamond/setup.py.in 2012-01-31 14:48:25 +0000
4@@ -9,12 +9,32 @@
5 except KeyError:
6 destdir = ""
7
8+prefix = None
9+import sys
10+for i, arg in enumerate(sys.argv):
11+ if "--prefix" in arg:
12+ prefix = arg.split('=')[1]
13+ break
14+
15 # Get all the plugin directories we have
16 plugin_dirs = [dir for dir in os.listdir('plugins') if os.path.isdir(os.path.join('plugins', dir)) and dir[0] != '.']
17 plugin_data_files = []
18 for plugin in plugin_dirs:
19- plugin_data_files.append((destdir + "@prefix@/share/diamond/plugins/" + plugin,
20- glob.glob('plugins/' + plugin + '/*.py')))
21+ if prefix is None:
22+ plugin_data_files.append((destdir + "@prefix@/share/diamond/plugins/" + plugin,
23+ glob.glob('plugins/' + plugin + '/*.py')))
24+ else:
25+ plugin_data_files.append((destdir + "/" + prefix + "/share/diamond/plugins/" + plugin,
26+ glob.glob('plugins/' + plugin + '/*.py')))
27+
28+# Consider whether we honour the configure or the setup prefix
29+gui_data_files = []
30+if prefix is None:
31+ gui_data_files.append((destdir + "@prefix@/share/diamond/gui",
32+ ["gui/gui.glade", "gui/diamond.svg"]))
33+else:
34+ gui_data_files.append((destdir + "/" + prefix + "/share/diamond/gui",
35+ ["gui/gui.glade", "gui/diamond.svg"]))
36
37 setup(
38 name='diamond',
39@@ -26,7 +46,6 @@
40 packages = ['diamond'],
41 package_dir = {'diamond': 'diamond'},
42 scripts=["bin/diamond"],
43- data_files = [(destdir + "@prefix@/share/diamond/gui", ["gui/gui.glade", "gui/diamond.svg"])] +
44- plugin_data_files
45+ data_files = gui_data_files + plugin_data_files
46 )
47

Subscribers

People subscribed via source and target branches