pull: fix edge cases
CI / build (push) Failing after 13m53s
CI / snap (push) Has been skipped

- Ubuntu does not have 'Launchpad/Code' repo edge case
- Vcs-Git field has a git command, not only an URL edge case
This commit is contained in:
2026-03-17 17:22:25 +01:00
parent dce39c9a84
commit 5ec675c20b
2 changed files with 35 additions and 4 deletions
+9 -1
View File
@@ -153,6 +153,14 @@ impl Iterator for DebianSources {
}
}
// Parse Vcs-Git field: it may contain just a URL, or URL followed by -b <branch>
// e.g., "https://salsa.debian.org/science-team/paraview.git -b debian/latest"
let vcs_git = fields.get("Vcs-Git").map(|vcs| {
// Split on whitespace and take the first part (the URL)
// The URL should not contain spaces, so this is safe
vcs.split_whitespace().next().unwrap_or(vcs).to_string()
});
Some(PackageStanza {
package: fields.get("Package").unwrap().to_string(),
version: fields.get("Version").unwrap().to_string(),
@@ -161,7 +169,7 @@ impl Iterator for DebianSources {
.get("Format")
.cloned()
.unwrap_or_else(|| "1.0".to_string()),
vcs_git: fields.get("Vcs-Git").cloned(),
vcs_git,
vcs_browser: fields.get("Vcs-Browser").cloned(),
files,
})