Merge lp:~pefarrell/spud/diamond-setup into lp:spud

Proposed by Patrick Farrell
Status: Merged
Approved by: Tim Greaves
Approved revision: 519
Merged at revision: 519
Proposed branch: lp:~pefarrell/spud/diamond-setup
Merge into: lp:spud
Diff against target: 147 lines (+23/-23)
3 files modified
config.guess (+5/-4)
config.sub (+14/-5)
diamond/setup.py.in (+4/-14)
To merge this branch: bzr merge lp:~pefarrell/spud/diamond-setup
Reviewer Review Type Date Requested Status
Cian Wilson Approve
Tim Greaves Approve
Review via email: mp+95159@code.launchpad.net

Description of the change

This branch fixes the setup.py issues for diamond, and in the process simplifies it considerably.

The root problem (ha ha) was that the target directory of the data_files was supplied as

'//usr/share/whatever'

instead of

'/usr/share/whatever'. In my opinion that shouldn't matter, but in distutils' opinion, it means it should ignore the --root command for the data_files.

This means we can get rid of pulling the --root out of sys.argv ourselves, and get rid of looking up the environment variable DESTDIR.

To post a comment you must log in.
Revision history for this message
Tim Greaves (tim-greaves) wrote :

Confused by the appearance of the config.guess and config.sub changes - are these intentional?

The rest looks good for removing the root and destdir complexity.

Probably silly question - but at what stage is the additional leading / being dealt with, given it's not apparent from this merge?

Thanks for looking at this!

Revision history for this message
Stephan Kramer (s-kramer) wrote :

> Confused by the appearance of the config.guess and config.sub changes - are these intentional?

That's probably related to this bug: https://bugs.launchpad.net/spud/+bug/942835

Revision history for this message
Tim Greaves (tim-greaves) wrote :

OK, yes, afraid I'm not keeping up too well today.

In which case - assuming we are dealing with the additional leading / elsewhere, this looks fine to simplify setup.py.in

review: Approve
Revision history for this message
Cian Wilson (cwilson) wrote :

Yes, I filed a separate bug report for those modified files - though they now don't get modified locally from this branch presumably because the changes have been committed.

I can confirm that this merge fixes bug #942831 for me, i.e. diamond opens successfully after being installed from packages that were built from the source.

Happy to approve assuming there's a conclusion about the unexpectedly modified files.

review: Approve
Revision history for this message
Patrick Farrell (pefarrell) wrote :

When I merge, I will only merge the code changes. We will fix lp:942835 separately.

Where is the leading '/' being dealt with? It is removed from lines 133/144 of setup.py.in.

Revision history for this message
Tim Greaves (tim-greaves) wrote :

I'm being blind, yes, I see now. Thanks.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'config.guess'
--- config.guess 2012-01-25 14:00:49 +0000
+++ config.guess 2012-02-29 12:22:18 +0000
@@ -1,10 +1,10 @@
1#! /bin/sh1#! /bin/sh
2# Attempt to guess a canonical system name.2# Attempt to guess a canonical system name.
3# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,3# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
4# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 20094# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
5# Free Software Foundation, Inc.5# Free Software Foundation, Inc.
66
7timestamp='2009-11-20'7timestamp='2009-12-30'
88
9# This file is free software; you can redistribute it and/or modify it9# This file is free software; you can redistribute it and/or modify it
10# under the terms of the GNU General Public License as published by10# under the terms of the GNU General Public License as published by
@@ -56,8 +56,9 @@
56GNU config.guess ($timestamp)56GNU config.guess ($timestamp)
5757
58Originally written by Per Bothner.58Originally written by Per Bothner.
59Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,59Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
602002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.602001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free
61Software Foundation, Inc.
6162
62This is free software; see the source for copying conditions. There is NO63This is free software; see the source for copying conditions. There is NO
63warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."64warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
6465
=== modified file 'config.sub'
--- config.sub 2012-01-25 14:00:49 +0000
+++ config.sub 2012-02-29 12:22:18 +0000
@@ -1,10 +1,10 @@
1#! /bin/sh1#! /bin/sh
2# Configuration validation subroutine script.2# Configuration validation subroutine script.
3# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,3# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
4# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 20094# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
5# Free Software Foundation, Inc.5# Free Software Foundation, Inc.
66
7timestamp='2009-11-20'7timestamp='2010-01-22'
88
9# This file is (in principle) common to ALL GNU software.9# This file is (in principle) common to ALL GNU software.
10# The presence of a machine in this file suggests that SOME GNU software10# The presence of a machine in this file suggests that SOME GNU software
@@ -75,8 +75,9 @@
75version="\75version="\
76GNU config.sub ($timestamp)76GNU config.sub ($timestamp)
7777
78Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,78Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
792002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.792001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free
80Software Foundation, Inc.
8081
81This is free software; see the source for copying conditions. There is NO82This is free software; see the source for copying conditions. There is NO
82warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."83warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -380,7 +381,8 @@
380 | sparclite-* \381 | sparclite-* \
381 | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \382 | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
382 | tahoe-* | thumb-* \383 | tahoe-* | thumb-* \
383 | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* | tile-* \384 | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
385 | tile-* | tilegx-* \
384 | tron-* \386 | tron-* \
385 | ubicom32-* \387 | ubicom32-* \
386 | v850-* | v850e-* | vax-* \388 | v850-* | v850e-* | vax-* \
@@ -1085,6 +1087,11 @@
1085 basic_machine=tic6x-unknown1087 basic_machine=tic6x-unknown
1086 os=-coff1088 os=-coff
1087 ;;1089 ;;
1090 # This must be matched before tile*.
1091 tilegx*)
1092 basic_machine=tilegx-unknown
1093 os=-linux-gnu
1094 ;;
1088 tile*)1095 tile*)
1089 basic_machine=tile-unknown1096 basic_machine=tile-unknown
1090 os=-linux-gnu1097 os=-linux-gnu
@@ -1435,6 +1442,8 @@
1435 -dicos*)1442 -dicos*)
1436 os=-dicos1443 os=-dicos
1437 ;;1444 ;;
1445 -nacl*)
1446 ;;
1438 -none)1447 -none)
1439 ;;1448 ;;
1440 *)1449 *)
14411450
=== modified file 'diamond/setup.py.in'
--- diamond/setup.py.in 2012-02-27 17:09:38 +0000
+++ diamond/setup.py.in 2012-02-29 12:22:18 +0000
@@ -12,12 +12,6 @@
12# system. This will be a local directory to install into, and act as local '/'12# system. This will be a local directory to install into, and act as local '/'
13# as far as all paths are concerned. Check for this, and fail nicely if not set.13# as far as all paths are concerned. Check for this, and fail nicely if not set.
1414
15try:
16 destdir = os.environ["DESTDIR"]
17except KeyError:
18 destdir = ""
19
20
21prefix = None15prefix = None
22import sys16import sys
2317
@@ -35,8 +29,6 @@
35for i, arg in enumerate(sys.argv):29for i, arg in enumerate(sys.argv):
36 if "--prefix" in arg:30 if "--prefix" in arg:
37 prefix = arg.split('=')[1]31 prefix = arg.split('=')[1]
38 if "--root" in arg:
39 destdir = arg.split('=')[1]
4032
41# Given the above prefix possibilities, as well as root and DESTDIR, we need to33# Given the above prefix possibilities, as well as root and DESTDIR, we need to
42# construct a list of data directories to be installed34# construct a list of data directories to be installed
@@ -44,8 +36,6 @@
44# * configure-supplied prefixes are dealt with by substitution directly into36# * configure-supplied prefixes are dealt with by substitution directly into
45# this file, with @ PREFIX @ being replaced.37# this file, with @ PREFIX @ being replaced.
46# * prefixes as command-line options are pushed by us38# * prefixes as command-line options are pushed by us
47# * DESTDIR and root have now been condensed into 'destdir' and are pushed
48# by us
49#39#
50# Note that in the case of this and other packages which supply prefix twice40# Note that in the case of this and other packages which supply prefix twice
51# (once in configure, and then again on the command line) we honour the prefix41# (once in configure, and then again on the command line) we honour the prefix
@@ -56,19 +46,19 @@
56plugin_data_files = []46plugin_data_files = []
57for plugin in plugin_dirs:47for plugin in plugin_dirs:
58 if prefix is None:48 if prefix is None:
59 plugin_data_files.append((destdir + "@prefix@/share/diamond/plugins/" + plugin,49 plugin_data_files.append(("@prefix@/share/diamond/plugins/" + plugin,
60 glob.glob('plugins/' + plugin + '/*.py')))50 glob.glob('plugins/' + plugin + '/*.py')))
61 else:51 else:
62 plugin_data_files.append((destdir + "/" + prefix + "/share/diamond/plugins/" + plugin,52 plugin_data_files.append((prefix + "/share/diamond/plugins/" + plugin,
63 glob.glob('plugins/' + plugin + '/*.py')))53 glob.glob('plugins/' + plugin + '/*.py')))
6454
65# Now parse the GUI directories55# Now parse the GUI directories
66gui_data_files = []56gui_data_files = []
67if prefix is None:57if prefix is None:
68 gui_data_files.append((destdir + "@prefix@/share/diamond/gui",58 gui_data_files.append(("@prefix@/share/diamond/gui",
69 ["gui/gui.glade", "gui/diamond.svg"]))59 ["gui/gui.glade", "gui/diamond.svg"]))
70else:60else:
71 gui_data_files.append((destdir + "/" + prefix + "/share/diamond/gui",61 gui_data_files.append((prefix + "/share/diamond/gui",
72 ["gui/gui.glade", "gui/diamond.svg"]))62 ["gui/gui.glade", "gui/diamond.svg"]))
7363
74# We now have all the information we need; run setup.64# We now have all the information we need; run setup.

Subscribers

People subscribed via source and target branches