pull: fix edge cases
- 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:
+9
-1
@@ -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,
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user