Merge lp:~tsimonq2/ubuntu-cdimage/add-git-support-to-germinate into lp:ubuntu-cdimage

Proposed by Simon Quigley
Status: Merged
Merged at revision: 1693
Proposed branch: lp:~tsimonq2/ubuntu-cdimage/add-git-support-to-germinate
Merge into: lp:ubuntu-cdimage
Diff against target: 121 lines (+27/-26)
2 files modified
lib/cdimage/germinate.py (+19/-18)
lib/cdimage/tests/test_germinate.py (+8/-8)
To merge this branch: bzr merge lp:~tsimonq2/ubuntu-cdimage/add-git-support-to-germinate
Reviewer Review Type Date Requested Status
Steve Langasek Approve
Review via email: mp+335604@code.launchpad.net

Description of the change

This adds support for seeds being in Git rather than Bazaar. It adds a pattern variable much like the existing one to make it extendable for other flavors who also want to convert their seed over, and the usage of the deprecated (says the manpage) `--bzr` flag is replaced by usage of the `--vcs` flag, which makes this backwards-compatible in that it will automatically detect the right VCS (and if it doesn't, tries Git, then tries Bazaar if that doesn't work, so it still automatically works either way). I know the latter change works because I made similar changes in lubuntu-meta 0.87.

Please merge this as soon as possible, because it fixes Lubuntu daily builds.

To post a comment you must log in.
Revision history for this message
Simon Quigley (tsimonq2) wrote :

I also fixed the implementation in the `scripts` branch, but there's no way for me to make an MP there (that I can see) so if this could be reviewed alongside it, that would be great: https://code.launchpad.net/~tsimonq2/+junk/ubuntu-archive-scripts

Revision history for this message
Steve Langasek (vorlon) :
review: Needs Fixing
Revision history for this message
Steve Langasek (vorlon) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/cdimage/germinate.py'
2--- lib/cdimage/germinate.py 2017-11-19 04:17:30 +0000
3+++ lib/cdimage/germinate.py 2018-01-03 22:15:34 +0000
4@@ -40,10 +40,10 @@
5
6
7 class Germination:
8- def __init__(self, config, prefer_bzr=True):
9+ def __init__(self, config, prefer_vcs=True):
10 self.config = config
11 # Set to False to use old-style seed checkouts.
12- self.prefer_bzr = prefer_bzr
13+ self.prefer_vcs = prefer_vcs
14
15 @property
16 def germinate_path(self):
17@@ -67,44 +67,45 @@
18 def seed_sources(self, project):
19 if self.config["LOCAL_SEEDS"]:
20 return [self.config["LOCAL_SEEDS"]]
21- elif self.prefer_bzr:
22- pattern = "http://bazaar.launchpad.net/~%s/ubuntu-seeds/"
23+ elif self.prefer_vcs:
24+ bzrpattern = "https://bazaar.launchpad.net/~%s/ubuntu-seeds/"
25+ gitpattern = "https://git.launchpad.net/~%s/ubuntu-seeds/+git/"
26 series = self.config["DIST"]
27 sources = [pattern % "ubuntu-core-dev"]
28 if project in ("kubuntu", "kubuntu-active", "kubuntu-plasma5"):
29 if series >= "oneiric":
30- sources.insert(0, pattern % "kubuntu-dev")
31+ sources.insert(0, bzrpattern % "kubuntu-dev")
32 elif project == "ubuntustudio":
33- sources.insert(0, pattern % "ubuntustudio-dev")
34+ sources.insert(0, bzrpattern % "ubuntustudio-dev")
35 elif project == "mythbuntu":
36- sources.insert(0, pattern % "mythbuntu-dev")
37+ sources.insert(0, bzrpattern % "mythbuntu-dev")
38 elif project == "xubuntu":
39 if series >= "intrepid":
40- sources.insert(0, pattern % "xubuntu-dev")
41+ sources.insert(0, bzrpattern % "xubuntu-dev")
42 elif project in ("lubuntu", "lubuntu-next"):
43- sources.insert(0, pattern % "lubuntu-dev")
44+ sources.insert(0, gitpattern % "lubuntu-dev")
45 elif project == "ubuntu-gnome":
46- sources.insert(0, pattern % "ubuntu-gnome-dev")
47+ sources.insert(0, bzrpattern % "ubuntu-gnome-dev")
48 elif project == "ubuntu-budgie":
49- sources.insert(0, pattern % "ubuntubudgie-dev")
50+ sources.insert(0, bzrpattern % "ubuntubudgie-dev")
51 elif project == "ubuntu-mate":
52- sources.insert(0, pattern % "ubuntu-mate-dev")
53+ sources.insert(0, bzrpattern % "ubuntu-mate-dev")
54 elif project == "ubuntu-moblin-remix":
55- sources.insert(0, pattern % "moblin")
56+ sources.insert(0, bzrpattern % "moblin")
57 elif project == "ubuntukylin":
58 if series >= "utopic":
59- sources.insert(0, pattern % "ubuntukylin-members")
60+ sources.insert(0, bzrpattern % "ubuntukylin-members")
61 return sources
62 else:
63 return ["http://people.canonical.com/~ubuntu-archive/seeds/"]
64
65 @property
66- def use_bzr(self):
67+ def use_vcs(self):
68 if self.config["LOCAL_SEEDS"]:
69 # Local changes may well not be committed.
70 return False
71 else:
72- return self.prefer_bzr
73+ return self.prefer_vcs
74
75 def make_index(self, project, arch, rel_target, rel_paths):
76 target = os.path.join(self.output_dir(project), rel_target)
77@@ -200,8 +201,8 @@
78 "--components", "main",
79 "--no-rdepends",
80 ]
81- if self.use_bzr:
82- command.append("--bzr")
83+ if self.use_vcs:
84+ command.append("--vcs")
85 if self.config.image_type == "source":
86 command.append("--always-follow-build-depends")
87 proxy_check_call(
88
89=== modified file 'lib/cdimage/tests/test_germinate.py'
90--- lib/cdimage/tests/test_germinate.py 2016-12-14 19:02:06 +0000
91+++ lib/cdimage/tests/test_germinate.py 2018-01-03 22:15:34 +0000
92@@ -112,21 +112,21 @@
93 self.assertEqual(sources, self.germination.seed_sources(project))
94
95 def test_seed_sources_non_bzr(self):
96- self.germination = Germination(self.config, prefer_bzr=False)
97+ self.germination = Germination(self.config, prefer_vcs=False)
98 self.config["DIST"] = "raring"
99 self.assertEqual(
100 ["http://people.canonical.com/~ubuntu-archive/seeds/"],
101 self.germination.seed_sources("ubuntu"))
102
103- def test_use_bzr_local_seeds(self):
104+ def test_use_vcs_local_seeds(self):
105 self.config["LOCAL_SEEDS"] = "http://www.example.org/"
106- self.assertFalse(self.germination.use_bzr)
107+ self.assertFalse(self.germination.use_vcs)
108
109- def test_use_bzr_honours_preference(self):
110- self.assertTrue(self.germination.prefer_bzr)
111- self.assertTrue(self.germination.use_bzr)
112- self.germination.prefer_bzr = False
113- self.assertFalse(self.germination.use_bzr)
114+ def test_use_vcs_honours_preference(self):
115+ self.assertTrue(self.germination.prefer_vcs)
116+ self.assertTrue(self.germination.use_vcs)
117+ self.germination.prefer_vcs = False
118+ self.assertFalse(self.germination.use_vcs)
119
120 def test_make_index(self):
121 self.config.root = self.use_temp_dir()

Subscribers

People subscribed via source and target branches