Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Limit old suite workaround #390

Merged
merged 1 commit into from
Jan 3, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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":
obbardc marked this conversation as resolved.
Show resolved Hide resolved
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")
obbardc marked this conversation as resolved.
Show resolved Hide resolved
}

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