Merge lp:~dbungert/ubuntu-cdimage/netinst-and-simplestreams into lp:ubuntu-cdimage

Proposed by Dan Bungert
Status: Rejected
Rejected by: Steve Langasek
Proposed branch: lp:~dbungert/ubuntu-cdimage/netinst-and-simplestreams
Merge into: lp:ubuntu-cdimage
Diff against target: 34 lines (+12/-1)
1 file modified
lib/cdimage/simplestreams.py (+12/-1)
To merge this branch: bzr merge lp:~dbungert/ubuntu-cdimage/netinst-and-simplestreams
Reviewer Review Type Date Requested Status
Steve Langasek Needs Resubmitting
Review via email: mp+428648@code.launchpad.net

Commit message

simplestreams: distinguish netinst iso from regular one

Description of the change

Fixes a simplestream related error when https://code.launchpad.net/~mwhudson/ubuntu-cdimage/netinst/ is applied.

To post a comment you must log in.
Revision history for this message
Steve Langasek (vorlon) wrote :

Not ready to land and the source code is moving to git. Please resubmit there when ready.

review: Needs Resubmitting

Unmerged revisions

2079. By Dan Bungert

simplestreams: distinguish netinst iso from regular one

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/cdimage/simplestreams.py'
2--- lib/cdimage/simplestreams.py 2021-10-21 14:17:18 +0000
3+++ lib/cdimage/simplestreams.py 2022-08-19 16:58:00 +0000
4@@ -141,6 +141,16 @@
5 return series.realversion
6 return match.group(1)
7
8+ def generate_item_name(self, file, ftype):
9+ """Return an item_name, based on filetype and filename.
10+
11+ In most cases the filetype is enough, but if there are multiple
12+ files with the same extension we need to distinguish them.
13+ """
14+ if '-netinst-' in file:
15+ return 'netinst-iso'
16+ return ftype
17+
18 def scan_published_item(self, publishing_dir, sha256sums, file):
19 """Scan and generate simplestream data for a published file."""
20 for extension in ("iso", "img", "img.xz", "manifest", "list",
21@@ -198,12 +208,13 @@
22 version_name = self.extract_release_identifier(file, series)
23 else:
24 version_name = identifier
25+ item_name = self.generate_item_name(file, data['ftype'])
26 content_id = "%s:%s" % (self.content_id, item_project)
27 product_name = '%s:%s:%s:%s' % (content_id, item_image_type,
28 series.version, arch)
29 self.cdimage_items.append(
30 (content_id, product_name, version_name,
31- data['ftype'], data, ))
32+ item_name, data, ))
33 self.prepare_product_info(product_name, item_project,
34 series, item_image_type, arch)
35

Subscribers

People subscribed via source and target branches