Skip to content

Commit

Permalink
Merge #390
Browse files Browse the repository at this point in the history
390: Limit old suite workaround r=obbardc a=andhe

The workaround for #361 that was applied in b3c1f76 breaks recipes for bookworm and newer.

This change makes the workaround less damaging (should atleast work with official debian releases for the forseeable future), while still far from perfect (any derivate distribution that is bookworm-based will fail).

Co-authored-by: Andreas Henriksson <[email protected]>
  • Loading branch information
bors[bot] and andhe authored Jan 3, 2023
2 parents 6c6e7dd + 18998ff commit 0c8e97d
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 @@ -52,6 +52,7 @@ package actions
import (
"fmt"
"io"
"log"
"os"
"path"
"strings"
Expand Down Expand Up @@ -157,6 +158,24 @@ func (d *DebootstrapAction) RunSecondStage(context debos.DebosContext) error {
return err
}

// Guess if suite is something before usr-is-merged was introduced
func (d *DebootstrapAction) isLikelyOldSuite() bool {
switch strings.ToLower(d.Suite) {
case "sid", "unstable":
return false
case "testing":
return false
case "bookworm":
return false
case "trixie":
return false
case "forky":
return false
default:
return true
}
}

func (d *DebootstrapAction) Run(context *debos.DebosContext) error {
d.LogStart()
cmdline := []string{"debootstrap"}
Expand Down Expand Up @@ -203,7 +222,12 @@ 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() {
log.Println("excluding usr-is-merged as package is not in suite")
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 0c8e97d

Please sign in to comment.