Skip to content

Commit

Permalink
Limit old suite workaround
Browse files Browse the repository at this point in the history
The workaround for go-debos#361
that was applied in go-debos@b3c1f76
breaks recipes for bookworm and newer.
  • Loading branch information
andhe committed Jan 3, 2023
1 parent 39630ad commit b3675ac
Showing 1 changed file with 25 additions and 1 deletion.
26 changes: 25 additions & 1 deletion actions/debootstrap_action.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,26 @@ func (d *DebootstrapAction) RunSecondStage(context debos.DebosContext) error {
return err
}

func (d *DebootstrapAction) isLikelyOldSuite() bool {
// Guess if suite is something before usr-is-merged was introduced
switch strings.ToLower(d.Suite) {
// these are known to have usr-is-merged.
case "sid", "unstable":
return false;
case "testing":
return false;
case "bookworm":
return false;
case "trixie":
return false;
case "forky":
return false;
// we can't list all derivate distributions suites, so use default.
default:
return true;
}
}

func (d *DebootstrapAction) Run(context *debos.DebosContext) error {
d.LogStart()
cmdline := []string{"debootstrap"}
Expand Down Expand Up @@ -203,7 +223,11 @@ func (d *DebootstrapAction) Run(context *debos.DebosContext) error {
cmdline = append(cmdline, fmt.Sprintf("--variant=%s", d.Variant))
}

cmdline = append(cmdline, "--exclude=usr-is-merged")
// workaround for https://github.com/go-debos/debos/issues/361
if d.isLikelyOldSuite() {
cmdline = append(cmdline, "--exclude=usr-is-merged")
}

cmdline = append(cmdline, d.Suite)
cmdline = append(cmdline, context.Rootdir)
cmdline = append(cmdline, d.Mirror)
Expand Down

0 comments on commit b3675ac

Please sign in to comment.