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.

Signed-off-by: Andreas Henriksson <[email protected]>
  • Loading branch information
andhe committed Jan 3, 2023
1 parent 39630ad commit 18998ff
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 18998ff

Please sign in to comment.