Merge lp:~vorlon/ubuntu-cdimage/index-img-xz into lp:ubuntu-cdimage

Proposed by Steve Langasek
Status: Merged
Merged at revision: 1768
Proposed branch: lp:~vorlon/ubuntu-cdimage/index-img-xz
Merge into: lp:ubuntu-cdimage
Diff against target: 105 lines (+21/-17)
1 file modified
lib/cdimage/tree.py (+21/-17)
To merge this branch: bzr merge lp:~vorlon/ubuntu-cdimage/index-img-xz
Reviewer Review Type Date Requested Status
Ubuntu CD Image Team Pending
Review via email: mp+359966@code.launchpad.net

Description of the change

When preparing http://cdimage.ubuntu.com/releases/18.04/beta/ for publication I noticed we had no description of the image in HEADER.html or in .htaccess. Turns out this is a longstanding bug with handling of images with . in the "extension".

Fix this, and add the new architectures that we're after.

http://cdimage.ubuntu.com/releases/18.04/beta/ is generated using a cowboyed deployment of this code.

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/cdimage/tree.py'
2--- lib/cdimage/tree.py 2018-11-30 00:05:10 +0000
3+++ lib/cdimage/tree.py 2018-12-01 00:22:50 +0000
4@@ -813,6 +813,7 @@
5 "amd64": "64-bit PC (AMD64)",
6 "amd64+mac": "64-bit Mac (AMD64)",
7 "arm64": "64-bit ARM (ARMv8/AArch64)",
8+ "arm64+raspi3": "Raspberry Pi 3 (64-bit ARM)",
9 "armel": "ARM EABI",
10 "armel+dove": "Marvell Dove",
11 "armel+imx51": "Freescale i.MX51",
12@@ -826,6 +827,7 @@
13 "armhf+ac100": "Toshiba AC100 / Dynabook AZ (Hard-Float)",
14 "armhf+mx5": "Freescale i.MX5x (Hard-Float)",
15 "armhf+nexus7": "Asus/Google Nexus7 Tablet",
16+ "armhf+raspi3": "Raspberry Pi 3 (Hard-Float)",
17 "hppa": "HP PA-RISC",
18 "i386": "32-bit PC (i386)",
19 "ia64": "IA-64",
20@@ -856,6 +858,8 @@
21 sentences.append("Choose this if you are at all unsure.")
22 elif arch == "arm64":
23 sentences.append("For 64-bit ARMv8 processors and above.")
24+ elif arch in ("arm64+raspi3", "armhf+raspi3"):
25+ sentences.append("For Raspberry Pi 3 boards.")
26 elif arch == "armel":
27 sentences.append("For ARMv7 processors and above.")
28 elif arch == "armel+dove":
29@@ -999,7 +1003,7 @@
30 def extensionstr(self, extension):
31 if extension == "img":
32 return "USB image"
33- elif extension == "img.gz":
34+ elif extension in ("img.gz", "img.xz"):
35 return "preinstalled SD Card image"
36 elif extension == "iso":
37 return "standard download"
38@@ -1110,7 +1114,8 @@
39 elif entry.startswith("%s-" % prefix_type):
40 if (entry.endswith(".list") or
41 entry.endswith(".img.gz") or
42- entry.endswith(".tar.gz")):
43+ entry.endswith(".tar.gz") or
44+ entry.endswith(".img.xz")):
45 images.append(entry)
46 return images
47
48@@ -1157,8 +1162,8 @@
49 "armel", "armel+dove", "armel+imx51", "armel+omap", "armel+omap4",
50 "armel+ac100", "armel+mx5",
51 "armhf", "armhf+omap", "armhf+omap4", "armhf+ac100", "armhf+mx5",
52- "armhf+nexus7", "armhf+raspi2",
53- "arm64",
54+ "armhf+nexus7", "armhf+raspi2", "armhf+raspi3",
55+ "arm64", "arm64+raspi3",
56 "powerpc",
57 "powerpc+ps3",
58 "ppc64el",
59@@ -1366,25 +1371,25 @@
60 ):
61 paths = []
62 if image_format == "img" or image_format == "img.xz":
63- path = os.path.join(
64+ base = os.path.join(
65 directory,
66- "%s-%s.%s" % (
67- prefix, publish_type, image_format))
68+ "%s-%s" % (prefix, publish_type))
69+ path = "%s.%s" % (base, image_format)
70 if os.path.exists(path):
71- paths.append((path, None))
72+ paths.append((path, None, base))
73 elif image_format == "tar.xz":
74 for arch in arches:
75- path = os.path.join(
76- directory, "%s.%s" % (arch, image_format))
77+ base = os.path.join(directory, arch)
78+ path = "%s.%s" % (base, image_format)
79 if os.path.exists(path):
80- paths.append((path, arch))
81+ paths.append((path, arch, base))
82 for arch in arches:
83- path = os.path.join(
84+ base = os.path.join(
85 directory,
86- "%s-%s-%s.%s" % (
87- prefix, publish_type, arch, image_format))
88+ "%s-%s-%s" % (prefix, publish_type, arch))
89+ path = "%s.%s" % (base, image_format)
90 if os.path.exists(path):
91- paths.append((path, arch))
92+ paths.append((path, arch, base))
93 if not paths:
94 continue
95
96@@ -1408,8 +1413,7 @@
97 print('<div class="col-6 p-divider__block">',
98 file=header)
99
100- for path, arch in paths:
101- base = path.rsplit(".", 1)[0]
102+ for path, arch, base in paths:
103 if arch is None:
104 if publish_type == "mid":
105 imgarch = "lpia"

Subscribers

People subscribed via source and target branches