fix(dankinstaller): update OBS repo handling for Debian distro variants

Fixes #3070
Port 1.5

(cherry picked from commit faeced373f)
This commit is contained in:
purian23
2026-08-14 21:17:22 +00:00
committed by dms-ci[bot]
parent fb183eae2c
commit 2aa8f00fea
2 changed files with 5 additions and 11 deletions
+4 -10
View File
@@ -474,13 +474,8 @@ func (d *DebianDistribution) enableOBSRepos(ctx context.Context, obsPkgs []Packa
return fmt.Errorf("failed to get OS info: %w", err)
}
// Determine Debian version for OBS repository URL
debianVersion := "Debian_13"
if osInfo.VersionID == "testing" {
debianVersion = "Debian_Testing"
} else if osInfo.VersionCodename == "sid" || osInfo.VersionID == "sid" || strings.Contains(strings.ToLower(osInfo.PrettyName), "sid") || strings.Contains(strings.ToLower(osInfo.PrettyName), "unstable") {
debianVersion = "Debian_Unstable"
}
obsRepo := debianOBSRepoVersion(osInfo, readDebianAPTSuites())
d.log(fmt.Sprintf("Using OBS Debian repository: %s", obsRepo))
for _, pkg := range obsPkgs {
if pkg.RepoURL != "" && !enabledRepos[pkg.RepoURL] {
@@ -489,12 +484,11 @@ func (d *DebianDistribution) enableOBSRepos(ctx context.Context, obsPkgs []Packa
// RepoURL format: "home:AvengeMedia:danklinux"
repoPath := strings.ReplaceAll(pkg.RepoURL, ":", ":/")
repoName := strings.ReplaceAll(pkg.RepoURL, ":", "-")
baseURL := fmt.Sprintf("https://download.opensuse.org/repositories/%s/%s", repoPath, debianVersion)
baseURL := fmt.Sprintf("https://download.opensuse.org/repositories/%s/%s", repoPath, obsRepo)
// Check if repository already exists
listFile := fmt.Sprintf("/etc/apt/sources.list.d/%s.list", repoName)
checkCmd := exec.CommandContext(ctx, "test", "-f", listFile)
if checkCmd.Run() == nil {
if debianOBSListFileMatches(listFile, obsRepo) {
d.log(fmt.Sprintf("OBS repo %s already exists, skipping", pkg.RepoURL))
enabledRepos[pkg.RepoURL] = true
continue
+1 -1
View File
@@ -104,7 +104,7 @@ func IsUnsupportedDistro(distroID, versionID string) bool {
if distroID == "debian" {
// unstable/sid support
if versionID == "sid" {
if versionID == "sid" || versionID == "testing" {
return false
}
if versionID == "" {