Build in /tmp and immediately discard

This commit is contained in:
2026-04-14 09:49:36 +02:00
parent b766ff1348
commit bf7c844f2e
3 changed files with 158 additions and 6 deletions
+16 -2
View File
@@ -180,6 +180,7 @@ func runBuildModule(ctx context) error {
type buildHAKOptions struct {
filteredHAKs []string
filteredArchives []string
planOnly bool
}
@@ -205,7 +206,10 @@ func runBuildHAKs(ctx context) error {
if opts.planOnly {
result, err = pipeline.PlanHAKsWithProgress(p, progress)
} else {
result, err = pipeline.BuildHAKsWithProgress(p, progress)
result, err = pipeline.BuildHAKsWithOptions(p, pipeline.BuildHAKOptions{
Progress: progress,
ArchiveNames: opts.filteredArchives,
})
}
if err != nil {
return err
@@ -230,13 +234,19 @@ func parseBuildHAKArgs(args []string) (buildHAKOptions, error) {
arg := args[index]
switch arg {
case "-h", "--help":
return opts, errors.New("usage: build-haks [--hak <hak-name> ...] [--plan-only]")
return opts, errors.New("usage: build-haks [--hak <hak-name> ...] [--archive <archive-name> ...] [--plan-only]")
case "--hak":
index++
if index >= len(args) {
return opts, errors.New("--hak requires a value")
}
opts.filteredHAKs = append(opts.filteredHAKs, args[index])
case "--archive":
index++
if index >= len(args) {
return opts, errors.New("--archive requires a value")
}
opts.filteredArchives = append(opts.filteredArchives, args[index])
case "--plan-only":
opts.planOnly = true
default:
@@ -244,6 +254,10 @@ func parseBuildHAKArgs(args []string) (buildHAKOptions, error) {
opts.filteredHAKs = append(opts.filteredHAKs, value)
continue
}
if value, ok := parseInlineFlagValue(arg, "--archive"); ok {
opts.filteredArchives = append(opts.filteredArchives, value)
continue
}
return opts, fmt.Errorf("unknown build-haks argument %q", arg)
}
}