Merge lp:~jtaylor/ubuntu/precise/python-numpy/lp956901 into lp:ubuntu/precise/python-numpy

Proposed by Julian Taylor on 2012-03-16
Status: Merged
Merged at revision: 23
Proposed branch: lp:~jtaylor/ubuntu/precise/python-numpy/lp956901
Merge into: lp:ubuntu/precise/python-numpy
Diff against target: 96 lines (+29/-13)
6 files modified
.pc/.quilt_patches (+1/-0)
.pc/.quilt_series (+1/-0)
debian/changelog (+7/-0)
debian/control (+1/-0)
debian/patches/search-multiarch-paths.patch (+10/-7)
numpy/distutils/system_info.py (+9/-6)
To merge this branch: bzr merge lp:~jtaylor/ubuntu/precise/python-numpy/lp956901
Reviewer Review Type Date Requested Status
Martin Pitt 2012-03-16 Approve on 2012-03-19
Review via email: mp+97974@code.launchpad.net

Description of the Change

use gcc -print-multiarch instead of dpkg-architecture and recommend it, also wrap it into a try except and add a error message if gcc is missing

To post a comment you must log in.
24. By Julian Taylor on 2012-03-18

use decode to make the patch compatible with python3

Martin Pitt (pitti) wrote :

Thanks!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file '.pc/.quilt_patches'
2--- .pc/.quilt_patches 1970-01-01 00:00:00 +0000
3+++ .pc/.quilt_patches 2012-03-18 21:26:18 +0000
4@@ -0,0 +1,1 @@
5+debian/patches
6
7=== added file '.pc/.quilt_series'
8--- .pc/.quilt_series 1970-01-01 00:00:00 +0000
9+++ .pc/.quilt_series 2012-03-18 21:26:18 +0000
10@@ -0,0 +1,1 @@
11+series
12
13=== added file '.pc/search-multiarch-paths.patch/.timestamp'
14=== modified file 'debian/changelog'
15--- debian/changelog 2012-02-11 12:55:21 +0000
16+++ debian/changelog 2012-03-18 21:26:18 +0000
17@@ -1,3 +1,10 @@
18+python-numpy (1:1.6.1-5ubuntu2) precise; urgency=low
19+
20+ * update search-multiarch-paths.patch (LP: #956901)
21+ use gcc -print-multiarch to detect the path and recommend gcc
22+
23+ -- Julian Taylor <jtaylor@ubuntu.com> Fri, 16 Mar 2012 20:25:31 +0100
24+
25 python-numpy (1:1.6.1-5ubuntu1) precise; urgency=low
26
27 * debian/patches/search-multiarch-paths.patch: (LP: #818867)
28
29=== modified file 'debian/control'
30--- debian/control 2012-02-11 12:55:21 +0000
31+++ debian/control 2012-03-18 21:26:18 +0000
32@@ -14,6 +14,7 @@
33 Package: python-numpy
34 Architecture: any
35 Depends: ${python:Depends}, ${shlibs:Depends}, ${misc:Depends}
36+Recommends: gcc
37 Suggests: python-numpy-doc, python-numpy-dbg, python-nose (>= 0.10.1), python-dev, gfortran
38 Provides: ${python:Provides}, ${numpy:Provides}, python-numpy-dev, python-f2py
39 Description: Numerical Python adds a fast array facility to the Python language
40
41=== modified file 'debian/patches/search-multiarch-paths.patch'
42--- debian/patches/search-multiarch-paths.patch 2012-02-11 12:55:21 +0000
43+++ debian/patches/search-multiarch-paths.patch 2012-03-18 21:26:18 +0000
44@@ -6,16 +6,19 @@
45
46 --- a/numpy/distutils/system_info.py
47 +++ b/numpy/distutils/system_info.py
48-@@ -201,6 +201,12 @@
49+@@ -201,6 +201,15 @@
50 '/usr/lib'], platform_bits)
51 default_x11_include_dirs = ['/usr/X11R6/include','/usr/X11/include',
52 '/usr/include']
53-+ import subprocess as sp
54-+ p = sp.Popen(["dpkg-architecture", "-qDEB_HOST_MULTIARCH"], stdout=sp.PIPE)
55-+ triplet = p.communicate()[0].strip()
56-+ if p.returncode == 0:
57-+ default_x11_lib_dirs += [os.path.join("/usr/lib/", triplet)]
58-+ default_lib_dirs += [os.path.join("/usr/lib/", triplet)]
59++ try:
60++ import subprocess as sp
61++ p = sp.Popen(["gcc", "-print-multiarch"], stdout=sp.PIPE)
62++ triplet = str(p.communicate()[0].decode().strip())
63++ if p.returncode == 0:
64++ default_x11_lib_dirs += [os.path.join("/usr/lib/", triplet)]
65++ default_lib_dirs += [os.path.join("/usr/lib/", triplet)]
66++ except:
67++ warnings.warn('failed to detect multiarch paths, please install gcc')
68
69 if os.path.join(sys.prefix, 'lib') not in default_lib_dirs:
70 default_lib_dirs.insert(0,os.path.join(sys.prefix, 'lib'))
71
72=== modified file 'numpy/distutils/system_info.py'
73--- numpy/distutils/system_info.py 2012-02-11 12:55:21 +0000
74+++ numpy/distutils/system_info.py 2012-03-18 21:26:18 +0000
75@@ -201,12 +201,15 @@
76 '/usr/lib'], platform_bits)
77 default_x11_include_dirs = ['/usr/X11R6/include','/usr/X11/include',
78 '/usr/include']
79- import subprocess as sp
80- p = sp.Popen(["dpkg-architecture", "-qDEB_HOST_MULTIARCH"], stdout=sp.PIPE)
81- triplet = p.communicate()[0].strip()
82- if p.returncode == 0:
83- default_x11_lib_dirs += [os.path.join("/usr/lib/", triplet)]
84- default_lib_dirs += [os.path.join("/usr/lib/", triplet)]
85+ try:
86+ import subprocess as sp
87+ p = sp.Popen(["gcc", "-print-multiarch"], stdout=sp.PIPE)
88+ triplet = str(p.communicate()[0].decode().strip())
89+ if p.returncode == 0:
90+ default_x11_lib_dirs += [os.path.join("/usr/lib/", triplet)]
91+ default_lib_dirs += [os.path.join("/usr/lib/", triplet)]
92+ except:
93+ warnings.warn('failed to detect multiarch paths, please install gcc')
94
95 if os.path.join(sys.prefix, 'lib') not in default_lib_dirs:
96 default_lib_dirs.insert(0,os.path.join(sys.prefix, 'lib'))

Subscribers

People subscribed via source and target branches

to all changes: