Merge lp:~cjwatson/launchpad/bpb-external-dependencies-2 into lp:launchpad

Proposed by Colin Watson on 2016-01-07
Status: Merged
Merged at revision: 17883
Proposed branch: lp:~cjwatson/launchpad/bpb-external-dependencies-2
Merge into: lp:launchpad
Diff against target: 50 lines (+24/-2)
2 files modified
lib/lp/soyuz/adapters/archivedependencies.py (+9/-2)
lib/lp/soyuz/doc/archive-dependencies.txt (+15/-0)
To merge this branch: bzr merge lp:~cjwatson/launchpad/bpb-external-dependencies-2
Reviewer Review Type Date Requested Status
William Grant code 2016-01-07 Approve on 2016-01-08
Review via email: mp+281914@code.launchpad.net

Commit message

Actually honour BinaryPackageBuild.external_dependencies.

Description of the change

Actually honour BinaryPackageBuild.external_dependencies. The previous change accepted it but didn't dispatch it to builders.

To post a comment you must log in.
William Grant (wgrant) :
review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/lp/soyuz/adapters/archivedependencies.py'
2--- lib/lp/soyuz/adapters/archivedependencies.py 2015-08-04 11:03:04 +0000
3+++ lib/lp/soyuz/adapters/archivedependencies.py 2016-01-07 18:38:35 +0000
4@@ -1,4 +1,4 @@
5-# Copyright 2009-2014 Canonical Ltd. This software is licensed under the
6+# Copyright 2009-2016 Canonical Ltd. This software is licensed under the
7 # GNU Affero General Public License version 3 (see the file LICENSE).
8
9 """Archive dependencies helper function.
10@@ -243,7 +243,14 @@
11 _get_sources_list_for_dependencies(deps)
12
13 external_dep_lines = []
14- # Append external sources_list lines for this archive if it's
15+ # Append external sources.list lines for this build if specified. No
16+ # series substitution is needed here, so we don't have to worry about
17+ # malformedness.
18+ dependencies = build.external_dependencies
19+ if dependencies is not None:
20+ for line in dependencies.splitlines():
21+ external_dep_lines.append(line)
22+ # Append external sources.list lines for this archive if it's
23 # specified in the configuration.
24 try:
25 dependencies = build.archive.external_dependencies
26
27=== modified file 'lib/lp/soyuz/doc/archive-dependencies.txt'
28--- lib/lp/soyuz/doc/archive-dependencies.txt 2015-08-04 11:03:04 +0000
29+++ lib/lp/soyuz/doc/archive-dependencies.txt 2016-01-07 18:38:35 +0000
30@@ -501,6 +501,21 @@
31
32 >>> cprov.archive.external_dependencies = None
33
34+We can also set external dependencies for a single build.
35+
36+ >>> a_build.external_dependencies = (
37+ ... u"deb http://user:pass@repository foo bar")
38+ >>> print_building_sources_list(a_build)
39+ deb http://ppa.launchpad.dev/cprov/ppa/ubuntu hoary main
40+ deb http://user:pass@repository foo bar
41+ deb http://archive.launchpad.dev/ubuntu hoary
42+ main restricted universe multiverse
43+ deb http://archive.launchpad.dev/ubuntu hoary-security
44+ main restricted universe multiverse
45+ deb http://archive.launchpad.dev/ubuntu hoary-updates
46+ main restricted universe multiverse
47+ >>> a_build.external_dependencies = None
48+
49
50 == Build tools sources.list entries ==
51