Merge lp:~mvo/pkgme-devportal/raise-on-unsupported-architectures into lp:pkgme-devportal

Proposed by Michael Vogt
Status: Merged
Approved by: James Westby
Approved revision: 64
Merged at revision: 63
Proposed branch: lp:~mvo/pkgme-devportal/raise-on-unsupported-architectures
Merge into: lp:pkgme-devportal
Prerequisite: lp:~mvo/pkgme-devportal/i386-only-for-now
Diff against target: 77 lines (+16/-4)
3 files modified
acceptance/data/bundled_lib/Makefile (+3/-3)
acceptance/data/gtk/Makefile (+1/-1)
devportalbinary/binary.py (+12/-0)
To merge this branch: bzr merge lp:~mvo/pkgme-devportal/raise-on-unsupported-architectures
Reviewer Review Type Date Requested Status
Jonathan Lange Approve
Review via email: mp+115716@code.launchpad.net

Commit message

Raise an error if a binary is for a non-supported architecture.

Description of the change

This simply fails early it it detect architecture is not what we support. Not sure if that is the right place or if it should instead go into a different function. It also makes mixed native i386/native amd64 tarballs fail currently which is not what we want. But those mixed tarballs fail currently anyway so there is no regression.

To post a comment you must log in.
Revision history for this message
Jonathan Lange (jml) wrote :

I'm OK with this.

review: Approve
Revision history for this message
ISD Branch Mangler (isd-branches-mangler) wrote :

There are additional revisions which have not been approved in review. Please seek review and approval of these new revisions.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'acceptance/data/bundled_lib/Makefile'
--- acceptance/data/bundled_lib/Makefile 2012-07-16 18:13:36 +0000
+++ acceptance/data/bundled_lib/Makefile 2012-07-24 16:22:19 +0000
@@ -2,10 +2,10 @@
2all: libtest.so uselib2all: libtest.so uselib
33
4uselib: libtest.so4uselib: libtest.so
5 gcc -o $@ $@.c -L. -ltest5 gcc -o $@ $@.c -m32 -L. -ltest
66
7libtest.so: libtest.c7libtest.so: libtest.c
8 gcc -shared -fPIC -o $@ $<8 gcc -shared -m32 -fPIC -o $@ $<
99
10clean:10clean:
11 rm *~ *.o *.so uselib
12\ No newline at end of file11\ No newline at end of file
12 rm *~ *.o *.so uselib
1313
=== modified file 'acceptance/data/bundled_lib/libtest.so'
14Binary files acceptance/data/bundled_lib/libtest.so 2012-07-18 10:08:31 +0000 and acceptance/data/bundled_lib/libtest.so 2012-07-24 16:22:19 +0000 differ14Binary files acceptance/data/bundled_lib/libtest.so 2012-07-18 10:08:31 +0000 and acceptance/data/bundled_lib/libtest.so 2012-07-24 16:22:19 +0000 differ
=== modified file 'acceptance/data/bundled_lib/uselib'
15Binary files acceptance/data/bundled_lib/uselib 2012-07-18 10:05:58 +0000 and acceptance/data/bundled_lib/uselib 2012-07-24 16:22:19 +0000 differ15Binary files acceptance/data/bundled_lib/uselib 2012-07-18 10:05:58 +0000 and acceptance/data/bundled_lib/uselib 2012-07-24 16:22:19 +0000 differ
=== modified file 'acceptance/data/gtk/Makefile'
--- acceptance/data/gtk/Makefile 2011-11-15 17:27:30 +0000
+++ acceptance/data/gtk/Makefile 2012-07-24 16:22:19 +0000
@@ -1,3 +1,3 @@
1CFLAGS=`pkg-config --cflags gtk+-2.0`1CFLAGS=`pkg-config --cflags gtk+-2.0` -m32
22
3all: test_gtk3all: test_gtk
44
=== modified file 'acceptance/data/gtk/test_gtk'
5Binary files acceptance/data/gtk/test_gtk 2011-11-15 17:27:30 +0000 and acceptance/data/gtk/test_gtk 2012-07-24 16:22:19 +0000 differ5Binary files acceptance/data/gtk/test_gtk 2011-11-15 17:27:30 +0000 and acceptance/data/gtk/test_gtk 2012-07-24 16:22:19 +0000 differ
=== modified file 'devportalbinary/binary.py'
--- devportalbinary/binary.py 2012-07-24 15:05:27 +0000
+++ devportalbinary/binary.py 2012-07-24 16:22:19 +0000
@@ -71,6 +71,10 @@
71 """Raised when we do not know which dependency to add."""71 """Raised when we do not know which dependency to add."""
7272
7373
74class UnsupportedArchitecture(PkgmeError):
75 """Raised when we find a unsupported architecture."""
76
77
74def guess_executable(package_name, executables):78def guess_executable(package_name, executables):
75 """79 """
76 From a list of executables, guess which one is likely to be the main80 From a list of executables, guess which one is likely to be the main
@@ -130,6 +134,7 @@
130 binary_paths = list(binary_paths)134 binary_paths = list(binary_paths)
131 if not binary_paths:135 if not binary_paths:
132 raise NoBinariesFound()136 raise NoBinariesFound()
137 conf = load_configuration()
133 cmd = [OBJDUMP, '-f', '-p'] + binary_paths138 cmd = [OBJDUMP, '-f', '-p'] + binary_paths
134 output = run_subprocess(cmd)139 output = run_subprocess(cmd)
135 libraries = {}140 libraries = {}
@@ -144,6 +149,13 @@
144 libraries[current_binary] = []149 libraries[current_binary] = []
145 if line.startswith(' NEEDED'):150 if line.startswith(' NEEDED'):
146 libraries[current_binary].append(line.split()[1])151 libraries[current_binary].append(line.split()[1])
152 elif line.startswith('architecture: '):
153 # so... i386 is reported as "i386"
154 # *but* amd64 as "i386:x86-64"
155 architecture = line.partition(":")[2].partition(",")[0].strip()
156 if architecture not in conf.options.architectures_supported:
157 raise UnsupportedArchitecture(
158 "Can not handle '%s'" % architecture)
147 last_line_was_blank = this_line_blank159 last_line_was_blank = this_line_blank
148 return libraries160 return libraries
149161
150162
=== modified file 'devportalbinary/tests/data/bundled_library/libtest.so'
151Binary files devportalbinary/tests/data/bundled_library/libtest.so 2012-07-17 08:48:57 +0000 and devportalbinary/tests/data/bundled_library/libtest.so 2012-07-24 16:22:19 +0000 differ163Binary files devportalbinary/tests/data/bundled_library/libtest.so 2012-07-17 08:48:57 +0000 and devportalbinary/tests/data/bundled_library/libtest.so 2012-07-24 16:22:19 +0000 differ
=== modified file 'devportalbinary/tests/data/bundled_library/uselib'
152Binary files devportalbinary/tests/data/bundled_library/uselib 2012-07-17 08:48:57 +0000 and devportalbinary/tests/data/bundled_library/uselib 2012-07-24 16:22:19 +0000 differ164Binary files devportalbinary/tests/data/bundled_library/uselib 2012-07-17 08:48:57 +0000 and devportalbinary/tests/data/bundled_library/uselib 2012-07-24 16:22:19 +0000 differ
=== modified file 'devportalbinary/tests/data/hello/hello'
153Binary files devportalbinary/tests/data/hello/hello 2011-12-22 22:41:37 +0000 and devportalbinary/tests/data/hello/hello 2012-07-24 16:22:19 +0000 differ165Binary files devportalbinary/tests/data/hello/hello 2011-12-22 22:41:37 +0000 and devportalbinary/tests/data/hello/hello 2012-07-24 16:22:19 +0000 differ

Subscribers

People subscribed via source and target branches