pull: allow to force pull from archive
Some checks failed
CI / build (push) Failing after 1m2s

This commit is contained in:
2026-01-11 20:43:01 +01:00
parent 70e6d8c051
commit 91c812a530
3 changed files with 5 additions and 4 deletions

View File

@@ -341,6 +341,7 @@ pub async fn pull(
package_info: &PackageInfo,
cwd: Option<&Path>,
progress: ProgressCallback<'_>,
force_archive: bool,
) -> Result<(), Box<dyn Error>> {
let package = &package_info.stanza.package;
let series = &package_info.series;
@@ -351,7 +352,7 @@ pub async fn pull(
};
/* Fetch the package: either via git (preferred VCS) or the archive */
if let Some(ref url) = package_info.preferred_vcs {
if let Some(ref url) = package_info.preferred_vcs && !force_archive {
// We have found a preferred VCS (git repository) for the package, so
// we fetch the package from that repo.
@@ -441,7 +442,7 @@ mod tests {
let info = crate::package_info::lookup(package, None, series, "", dist, None)
.await
.unwrap();
pull(&info, Some(cwd), None).await.unwrap();
pull(&info, Some(cwd), None, false).await.unwrap();
let package_dir = cwd.join(package);
assert!(package_dir.exists());