Merge lp:~vorlon/xdeb/multiarch-foreign-builddeps into lp:xdeb

Proposed by Steve Langasek
Status: Merged
Merged at revision: 246
Proposed branch: lp:~vorlon/xdeb/multiarch-foreign-builddeps
Merge into: lp:xdeb
Diff against target: 80 lines (+25/-5)
2 files modified
debian/changelog (+3/-1)
xdeb.py (+22/-4)
To merge this branch: bzr merge lp:~vorlon/xdeb/multiarch-foreign-builddeps
Reviewer Review Type Date Requested Status
Loïc Minier Approve
Review via email: mp+50700@code.launchpad.net

Description of the change

Some preliminary multiarchification of xdeb: if a build-dependency is
Multi-Arch: foreign, we don't have to cross-build it just for sake of using
it as a build-dep, since we can install it in the build environment just
fine.

To post a comment you must log in.
246. By Steve Langasek

catch up with trunk

Revision history for this message
Loïc Minier (lool) wrote :

Looks good; did some minor adjustment to comments to honor some PEPs I was told to honor in linaro-image-tools ;-) also added some space between args in function calls

Thanks

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2011-01-31 23:22:04 +0000
3+++ debian/changelog 2011-02-22 06:33:11 +0000
4@@ -1,5 +1,7 @@
5-xdeb (0.6.3ubuntu1) UNRELEASED; urgency=low
6+xdeb (0.6.4) UNRELEASED; urgency=low
7
8+ * If a package is Multi-Arch: foreign, we don't need to build it unless we
9+ also want to install it in its own right.
10 * add tcl8.5 to the whitelist alongside tcl8.4.
11
12 -- Steve Langasek <steve.langasek@ubuntu.com> Mon, 31 Jan 2011 15:21:34 -0800
13
14=== modified file 'xdeb.py'
15--- xdeb.py 2010-10-15 22:51:03 +0000
16+++ xdeb.py 2011-02-22 06:33:11 +0000
17@@ -97,6 +97,23 @@
18 return tree.get_src_binaries(options, src)
19
20
21+def is_multiarch_foreign(options, pkg):
22+ """Check if Multi-Arch: foreign is set on the binary package pkg
23+ (doesn't need build if it's just a build-dep)"""
24+
25+ real_pkg = get_real_pkg(options,pkg)
26+ if real_pkg is None:
27+ return False
28+ record = get_pkg_record(options,real_pkg)
29+ if record is None:
30+ return False
31+
32+ if 'multi-arch' in record:
33+ return record['multi-arch'] == 'foreign'
34+ else:
35+ return False
36+
37+
38 def is_toolchain(pkg):
39 """Is this tool incapable of cross-building pkg?"""
40 return ('libc6' in pkg or 'lib32gcc' in pkg or 'lib64gcc' in pkg or
41@@ -171,12 +188,13 @@
42 new_deps.append(new_or_deps)
43 return new_deps
44
45-def should_expand(parent, pkg):
46+def should_expand(options, parent, pkg):
47 if pkg in explicit_requests:
48 # We're going to build it anyway because it was requested on the
49 # command line, so we might as well sequence it properly.
50 return True
51 return (is_crossable(pkg) and not is_toolchain(pkg) and
52+ not is_multiarch_foreign(options, pkg) and
53 not need_loop_break(parent, pkg))
54
55 def expand_depends(options, pkg, depth, builddep_depth,
56@@ -239,7 +257,7 @@
57 # break this cycle
58 continue
59 bd_pkg = builddep[0]['name']
60- if should_expand(src, bd_pkg):
61+ if should_expand(options, src, bd_pkg):
62 expand_depends(options, bd_pkg, depth + 1, builddep_depth + 1,
63 parent=src)
64
65@@ -255,13 +273,13 @@
66 # Check should_expand twice, once for the virtual package
67 # name and once for the real package name (which may be
68 # different).
69- if not should_expand(src, or_dep['name']):
70+ if not should_expand(options, src, or_dep['name']):
71 continue
72 # TODO version handling?
73 real_dep = get_real_pkg(options, or_dep['name'])
74 if (real_dep is not None and
75 get_src_name(options, real_dep) is not None):
76- if should_expand(src, real_dep):
77+ if should_expand(options, src, real_dep):
78 expand_depends(options, real_dep, depth + 1,
79 builddep_depth,
80 parent=src, parent_binary=binary)

Subscribers

People subscribed via source and target branches