diff --git a/live-build/auto/config b/live-build/auto/config index ef279cb5..ffed7790 100755 --- a/live-build/auto/config +++ b/live-build/auto/config @@ -175,8 +175,8 @@ add_task () fi for task; do - ./config/expand-task config/germinate-output $FLAVOUR $task packages >> "$pkg_file" - ./config/expand-task config/germinate-output $FLAVOUR $task snaps >> "$snap_file" + ./config/expand-task config/germinate-output $FLAVOUR $task packages $ARCH >> "$pkg_file" + ./config/expand-task config/germinate-output $FLAVOUR $task snaps $ARCH >> "$snap_file" done for file in $pkg_file $snap_file; do @@ -188,6 +188,52 @@ add_task () done } +add_task_pool () +{ + local pass="$1" + local task="$2" + shift + local task_pkgs + + if [ ! -e config/germinate-output/structure ]; then + echo "add_task_pool too soon" >&2 + exit 1 + fi + + mkdir -pv config/{gnupg,indices,hooks} + for component in $COMPONENTS; do + (cd config/indices && \ + wget $MIRROR/indices/override.$SUITE.$component && \ + wget $MIRROR/indices/override.$SUITE.extra.$component \ + ) + done + + for task; do + task_pkgs=$(./config/expand-task config/germinate-output $FLAVOUR $task packages $ARCH) + echo "!!!!!" >&2 + echo $FLAVOUR >&2 + echo $task >&2 + echo $task_pkgs >&2 + cat > config/hooks/100-livefs-pool.chroot <.+?)(?=\s+(?:\[[^\]]+\]|#)|\s*$)(?:\s+\[(?P[^\]]+)\])?(?:\s+#.*)?\s*$') +def print_seed_item(line): + m = seed_pattern.match(line) + + if m: + arch_tag = m.group("arch") + if arch_tag and args.arch not in arch_tag.split(): + return + + raw_pkg = m.group("raw_pkg") + if args.what == "snaps" and "(classic)" in raw_pkg: + raw_pkg += "/classic" + + # Remove e.g. surrounding slashes from entries + printable_m = re.match(r"^/\^(.*)\$/?$", raw_pkg) + packages.add(m.group(1) if printable_m else raw_pkg) + +passed = False +for seedtext in glob.glob(f"{args.output_dir}/*.seedtext"): hs = parseTaskHeaders(open(seedtext)) if not hs: continue @@ -75,12 +96,16 @@ for seedtext in glob.glob(f'{args.output_dir}/*.seedtext'): if tn != args.task: continue for seed in getTaskSeeds(hs, seedname): - for line in open(f'{args.output_dir}/{seed}{ext}'): - if re.match('^[a-z0-9]', line): - name = line.split()[0] - if args.what == 'snaps' and '(classic)' in line: - name += '/classic' - print(name) + for line in open(f"{args.output_dir}/{seed}{ext}"): + print_seed_item(line) + passed = True break -else: - raise Exception("did not find task %r" % (args.task,)) + +if not passed and not packages: + if args.task != "ship-live" or not os.path.exists(f"{args.output_dir}/{args.task}.seedtext"): + raise Exception(f"Unable to find {args.task}") + + for line in open(f"{args.output_dir}/{args.task}.seedtext"): + print_seed_item(line) + +print(" ".join(packages))