diff --git a/debian/changelog b/debian/changelog index a90ba22f..b92ac415 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,6 +2,8 @@ livecd-rootfs (2.838) UNRELEASED; urgency=medium * auto/config: Set FLAVOUR appropriately for flavours added since the expand-task branch was created. + * live-build/expand-task: Fix expansion of tasks with non-flavour specific + name (e.g. "minimal") when building a non-Ubuntu flavour. -- Michael Hudson-Doyle Wed, 17 May 2023 13:24:43 +1200 diff --git a/live-build/expand-task b/live-build/expand-task index fb309e7b..7219089f 100755 --- a/live-build/expand-task +++ b/live-build/expand-task @@ -35,25 +35,6 @@ def parseTaskHeaders(seedtext): task_headers[key.lower()] = value.strip() return task_headers - -def getTaskName(task_headers, flavour, seedname, primary_flavour): - """Work out the name of the Task to be generated from this seed. - - If there is a Task-Name header, it wins; otherwise, seeds with a - Task-Per-Derivative header are honoured for all flavours and put in - an appropriate namespace, while other seeds are only honoured for - the first flavour and have archive-global names. - """ - if "name" in task_headers: - return task_headers["name"] - elif "per-derivative" in task_headers: - return "%s-%s" % (flavour, seedname) - elif primary_flavour: - return seedname - else: - return None - - def getTaskSeeds(task_headers, seedname): """Return the list of seeds used to generate a task from this seed. @@ -66,13 +47,31 @@ def getTaskSeeds(task_headers, seedname): return sorted(scan_seeds) # end copy/paste from ubuntu-archive-publishing's generate_extra_overrides. +# This is not quite the same as the one in generate_extra_overrides, +# because for seeds that do not have flavour specific names, the Task +# override is only generated for the Ubuntu flavour rather than +# redundantly doing it for each flavour. +def getTaskName(task_headers, flavour, seedname): + """Work out the name of the Task to be generated from this seed. + + If there is a Task-Name header, it wins; otherwise, seeds with a + Task-Per-Derivative get put in an appropriate namespace. Other seeds + have a task name that matches the seed name. + """ + if "name" in task_headers: + return task_headers["name"] + elif "per-derivative" in task_headers: + return "%s-%s" % (flavour, seedname) + else: + return seedname + for seedtext in glob.glob(f'{args.output_dir}/*.seedtext'): hs = parseTaskHeaders(open(seedtext)) if not hs: continue seedname = os.path.splitext(os.path.basename(seedtext))[0] - tn = getTaskName(hs, args.flavour, seedname, args.flavour == 'ubuntu') + tn = getTaskName(hs, args.flavour, seedname) if tn != args.task: continue for seed in getTaskSeeds(hs, seedname):