Merge ~mwhudson/ubuntu-cdimage:no-jigdo into ubuntu-cdimage:main

Proposed by Michael Hudson-Doyle
Status: Merged
Merged at revision: 32f2de8c47d7a8ce3919bea2d29e201ea130e8eb
Proposed branch: ~mwhudson/ubuntu-cdimage:no-jigdo
Merge into: ubuntu-cdimage:main
Diff against target: 282 lines (+4/-137)
2 files modified
lib/cdimage/tests/test_tree.py (+0/-52)
lib/cdimage/tree.py (+4/-85)
Reviewer Review Type Date Requested Status
Steve Langasek Approve
Review via email: mp+456830@code.launchpad.net

Commit message

remove vestiges of jigdo support

debian-cd removed jigdo support a while ago so this is all pointless.

To post a comment you must log in.
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
1diff --git a/lib/cdimage/tests/test_tree.py b/lib/cdimage/tests/test_tree.py
2index 0392381..e3a4f06 100644
3--- a/lib/cdimage/tests/test_tree.py
4+++ b/lib/cdimage/tests/test_tree.py
5@@ -532,7 +532,6 @@ class TestPublisherWebIndices(TestCase):
6 "AddIcon ../../cdicons/folder.png ^^DIRECTORY^^\n"
7 "AddIcon ../../cdicons/iso.png .iso\n"
8 "AddIcon ../../cdicons/img.png .img .img.xz .tar.gz .tar.xz\n"
9- "AddIcon ../../cdicons/jigdo.png .jigdo .template\n"
10 "AddIcon ../../cdicons/list.png .list .manifest .html .zsync "
11 "SHA256SUMS SHA256SUMS.gpg\n"
12 "AddIcon ../../cdicons/torrent.png .torrent\n",
13@@ -623,7 +622,6 @@ class TestPublisherWebIndices(TestCase):
14 "AddIcon ../cdicons/folder.png ^^DIRECTORY^^\n"
15 "AddIcon ../cdicons/iso.png .iso\n"
16 "AddIcon ../cdicons/img.png .img .img.xz .tar.gz .tar.xz\n"
17- "AddIcon ../cdicons/jigdo.png .jigdo .template\n"
18 "AddIcon ../cdicons/list.png .list .manifest .html .zsync "
19 "SHA256SUMS SHA256SUMS.gpg\n"
20 "AddIcon ../cdicons/torrent.png .torrent\n",
21@@ -717,7 +715,6 @@ class TestPublisherWebIndices(TestCase):
22 "AddIcon ../../../cdicons/iso.png .iso\n"
23 "AddIcon ../../../cdicons/img.png .img .img.xz .tar.gz "
24 ".tar.xz\n"
25- "AddIcon ../../../cdicons/jigdo.png .jigdo .template\n"
26 "AddIcon ../../../cdicons/list.png .list .manifest .html "
27 ".zsync SHA256SUMS SHA256SUMS.gpg\n"
28 "AddIcon ../../../cdicons/torrent.png .torrent\n",
29@@ -980,29 +977,6 @@ class TestDailyTreePublisher(TestCase):
30 ["%s-alternate-amd64.iso" % self.config.series],
31 os.listdir(os.path.join(publisher.publish_base, "20130319")))
32
33- def test_jigdo_ports(self):
34- publisher = self.make_publisher("ubuntu", "daily")
35- for arch in ("amd64", "i386"):
36- self.assertFalse(publisher.jigdo_ports(arch))
37- for arch in ("armel", "armhf", "ppc64el", "s390x"):
38- self.assertTrue(publisher.jigdo_ports(arch))
39-
40- def test_replace_jigdo_mirror(self):
41- jigdo_path = os.path.join(self.temp_dir, "jigdo")
42- with mkfile(jigdo_path) as jigdo:
43- print("[Servers]", file=jigdo)
44- print("Debian=http://archive.ubuntu.com/ubuntu/ --try-last",
45- file=jigdo)
46- publisher = self.make_publisher("ubuntu", "daily")
47- publisher.replace_jigdo_mirror(
48- jigdo_path, "http://archive.ubuntu.com/ubuntu/",
49- "http://ports.ubuntu.com/ubuntu-ports")
50- with open(jigdo_path) as jigdo:
51- self.assertEqual(dedent("""\
52- [Servers]
53- Debian=http://ports.ubuntu.com/ubuntu-ports --try-last
54- """), jigdo.read())
55-
56 @mock.patch("cdimage.osextras.find_on_path", return_value=True)
57 @mock.patch("cdimage.tree.zsyncmake")
58 def test_publish_binary(self, mock_zsyncmake, *args):
59@@ -1336,35 +1310,23 @@ class TestDailyTreePublisher(TestCase):
60 source_dir = publisher.image_output("src")
61 touch(os.path.join(source_dir, "%s-src-1.raw" % self.config.series))
62 touch(os.path.join(source_dir, "%s-src-1.list" % self.config.series))
63- touch(os.path.join(source_dir, "%s-src-1.jigdo" % self.config.series))
64- touch(os.path.join(
65- source_dir, "%s-src-1.template" % self.config.series))
66 touch(os.path.join(source_dir, "%s-src-2.raw" % self.config.series))
67 touch(os.path.join(source_dir, "%s-src-2.list" % self.config.series))
68- touch(os.path.join(source_dir, "%s-src-2.jigdo" % self.config.series))
69- touch(os.path.join(
70- source_dir, "%s-src-2.template" % self.config.series))
71 self.capture_logging()
72 list(publisher.publish_source("20120807"))
73 self.assertLogEqual([
74 "Publishing source 1 ...",
75- "Publishing source 1 jigdo ...",
76 "Making source 1 zsync metafile ...",
77 "Publishing source 2 ...",
78- "Publishing source 2 jigdo ...",
79 "Making source 2 zsync metafile ...",
80 ])
81 target_dir = os.path.join(publisher.publish_base, "20120807", "source")
82 self.assertEqual([], os.listdir(source_dir))
83 self.assertCountEqual([
84 "%s-src-1.iso" % self.config.series,
85- "%s-src-1.jigdo" % self.config.series,
86 "%s-src-1.list" % self.config.series,
87- "%s-src-1.template" % self.config.series,
88 "%s-src-2.iso" % self.config.series,
89- "%s-src-2.jigdo" % self.config.series,
90 "%s-src-2.list" % self.config.series,
91- "%s-src-2.template" % self.config.series,
92 ], os.listdir(target_dir))
93 mock_zsyncmake.assert_has_calls([
94 mock.call(
95@@ -2514,20 +2476,6 @@ class TestReleasePublisherMixin:
96 self.get_publisher().remove_tree(os.path.dirname(path))
97 self.assertFalse(os.path.exists(os.path.dirname(path)))
98
99- def test_copy_jigdo(self):
100- old_path = os.path.join(self.temp_dir, "raring-alternate-amd64.jigdo")
101- new_path = os.path.join(
102- self.temp_dir, "ubuntu-13.04-alternate-amd64.jigdo")
103- with mkfile(old_path) as old:
104- print("Filename=raring-alternate-amd64.jigdo", file=old)
105- print("Template=raring-alternate-amd64.template", file=old)
106- self.get_publisher().copy_jigdo(old_path, new_path)
107- with open(new_path) as new:
108- self.assertEqual(
109- "Filename=ubuntu-13.04-alternate-amd64.jigdo\n"
110- "Template=ubuntu-13.04-alternate-amd64.template\n",
111- new.read())
112-
113 def test_mkemptydir(self):
114 path = os.path.join(self.temp_dir, "dir")
115 touch(os.path.join(path, "name"))
116diff --git a/lib/cdimage/tree.py b/lib/cdimage/tree.py
117index f4601c7..ce77467 100644
118--- a/lib/cdimage/tree.py
119+++ b/lib/cdimage/tree.py
120@@ -1011,8 +1011,6 @@ class Publisher:
121 elif extension.endswith(".torrent"):
122 return "%s download" % Link(
123 "https://help.ubuntu.com/community/BitTorrent", "BitTorrent")
124- elif extension == "jigdo":
125- return "%s download" % Link("http://atterer.org/jigdo", "jigdo")
126 elif extension == "list":
127 return "file listing"
128 elif extension == "manifest":
129@@ -1024,8 +1022,6 @@ class Publisher:
130 elif extension == "manifest-minimal-remove":
131 return "packages to remove from live filesystem on " + \
132 " installation when performing a minimal install"
133- elif extension == "template":
134- return "%s template" % Link("http://atterer.org/jigdo", "jigdo")
135 elif extension.endswith(".zsync"):
136 return "%s metafile" % Link("http://zsync.moria.org.uk/", "zsync")
137 elif extension == "vmlinuz-ec2":
138@@ -1454,11 +1450,11 @@ class Publisher:
139 "img.gz.torrent", "img.gz.zsync", "img.gz",
140 "img.xz", "img.tar.gz", "img.torrent",
141 "img.zsync", "img", "iso.torrent",
142- "iso.zsync", "iso", "jigdo", "list",
143+ "iso.zsync", "iso", "list",
144 "manifest", "manifest-desktop",
145 "manifest-remove",
146 "manifest-minimal-remove",
147- "template", "tar.gz", "tar.gz.zsync",
148+ "tar.gz", "tar.gz.zsync",
149 "bootimg", "tar.xz", "custom.tar.gz",
150 )
151 for extension in htaccess_extensions:
152@@ -1695,7 +1691,6 @@ class Publisher:
153 ("folder.png", "^^DIRECTORY^^"),
154 ("iso.png", ".iso"),
155 ("img.png", ".img .img.xz .tar.gz .tar.xz"),
156- ("jigdo.png", ".jigdo .template"),
157 ("list.png", (
158 ".list .manifest .html .zsync "
159 "SHA256SUMS SHA256SUMS.gpg")),
160@@ -1707,9 +1702,9 @@ class Publisher:
161
162 for extension in (
163 "img.gz.torrent", "img.gz", "img.torrent", "img",
164- "iso.torrent", "iso", "jigdo", "list", "manifest",
165+ "iso.torrent", "iso", "list", "manifest",
166 "manifest-desktop", "manifest-remove",
167- "manifest-minimal-remove", "template",
168+ "manifest-minimal-remove",
169 ):
170 mimetype = self.mimetypestr(extension)
171 if (mimetype and
172@@ -2017,18 +2012,6 @@ class DailyTreePublisher(Publisher):
173 logger.warning("Unknown file type '%s'; assuming .iso" % output)
174 return "iso"
175
176- def jigdo_ports(self, arch):
177- cpuarch = arch.split("+")[0]
178- return cpuarch in ("arm64", "armel", "armhf", "ppc64el", "s390x")
179-
180- def replace_jigdo_mirror(self, path, from_mirror, to_mirror):
181- with open(path) as jigdo_in:
182- with AtomicFile(path) as jigdo_out:
183- from_line = "Debian=%s" % from_mirror
184- to_line = "Debian=%s" % to_mirror
185- for line in jigdo_in:
186- jigdo_out.write(line.replace(from_line, to_line))
187-
188 def publish_netboot(self, arch, image_path):
189 # Publishing a netboot tarball is a bit more complicated than
190 # just copying it into place, as we also unpack it into a
191@@ -2090,21 +2073,6 @@ class DailyTreePublisher(Publisher):
192 self.config, target_dir, sign=False) as checksum_files:
193 checksum_files.remove("%s.%s" % (out_prefix, extension))
194
195- # Jigdo integration
196- if os.path.exists("%s.jigdo" % source_prefix):
197- logger.info("Publishing %s jigdo ..." % arch)
198- shutil.move("%s.jigdo" % source_prefix, "%s.jigdo" % target_prefix)
199- shutil.move(
200- "%s.template" % source_prefix, "%s.template" % target_prefix)
201- if self.jigdo_ports(arch):
202- self.replace_jigdo_mirror(
203- "%s.jigdo" % target_prefix,
204- "http://archive.ubuntu.com/ubuntu",
205- "http://ports.ubuntu.com/ubuntu-ports")
206- else:
207- osextras.unlink_force("%s.jigdo" % target_prefix)
208- osextras.unlink_force("%s.template" % target_prefix)
209-
210 # Live filesystem manifests
211 if os.path.exists("%s.manifest" % source_prefix):
212 logger.info("Publishing %s live manifest ..." % arch)
213@@ -2284,19 +2252,6 @@ class DailyTreePublisher(Publisher):
214 self.config, target_dir, sign=False) as checksum_files:
215 checksum_files.remove("%s.iso" % out_prefix)
216
217- # Jigdo integration
218- if os.path.exists("%s.jigdo" % source_prefix):
219- logger.info("Publishing source %d jigdo ..." % i)
220- shutil.move(
221- "%s.jigdo" % source_prefix, "%s.jigdo" % target_prefix)
222- shutil.move(
223- "%s.template" % source_prefix,
224- "%s.template" % target_prefix)
225- else:
226- logger.warning("No jigdo for source %d!" % i)
227- osextras.unlink_force("%s.jigdo" % target_prefix)
228- osextras.unlink_force("%s.template" % target_prefix)
229-
230 # zsync metafiles
231 if osextras.find_on_path("zsyncmake"):
232 logger.info("Making source %d zsync metafile ..." % i)
233@@ -3110,16 +3065,6 @@ class ReleasePublisher(Publisher):
234 def remove_tree(self, path):
235 self.do("rm -rf %s" % path, shutil.rmtree, path)
236
237- def copy_jigdo(self, source, target):
238- if self.dry_run:
239- logger.info("Would fix up jigdo file")
240- return
241- source_pat = "=%s" % os.path.basename(source).rsplit(".", 1)[0]
242- target_pat = "=%s" % os.path.basename(target).rsplit(".", 1)[0]
243- with open(source) as sf, open(target, "w") as tf:
244- for line in sf:
245- tf.write(line.replace(source_pat, target_pat))
246-
247 def mkemptydir(self, path):
248 if self.dry_run:
249 logger.info("rm -rf %s" % path)
250@@ -3264,32 +3209,6 @@ class ReleasePublisher(Publisher):
251 if self.want_full:
252 self.copy(daily(ext, "-"), full(ext, "-"))
253
254- if publish_type in (
255- "install", "alternate", "server", "serveraddon", "addon", "src",
256- "legacy-server",
257- ):
258- if (os.path.exists(daily("jigdo")) and
259- os.path.exists(daily("template"))):
260- if self.want_pool:
261- self.copy(daily("template"), pool("template"))
262- self.copy_jigdo(daily("jigdo"), pool("jigdo"))
263- if self.want_dist:
264- self.symlink(pool("template"), dist("template"))
265- self.symlink(pool("jigdo"), dist("jigdo"))
266- if self.want_full:
267- self.copy(daily("template"), full("template"))
268- self.copy_jigdo(daily("jigdo"), full("jigdo"))
269- else:
270- if self.want_pool:
271- self.remove(pool("template"))
272- self.remove(pool("jigdo"))
273- if self.want_dist:
274- self.remove(dist("template"))
275- self.remove(dist("jigdo"))
276- if self.want_full:
277- self.remove(full("template"))
278- self.remove(full("jigdo"))
279-
280 if self.want_manifest(publish_type, daily("manifest")):
281 # Copy, to make sure we have a canonical version of this.
282 if self.want_pool:

Subscribers

People subscribed via source and target branches