One comment out of date

This commit is contained in:
Neven Villani 2025-06-24 14:42:23 +02:00
parent ddaec8aa85
commit 3b84ce91e3

View File

@ -111,13 +111,13 @@ impl PackageStorage {
// None of the strategies above found the package, so all code paths // None of the strategies above found the package, so all code paths
// from now on fail. The rest of the function is only to determine the // from now on fail. The rest of the function is only to determine the
// cause of the failure. // cause of the failure.
// We try `namespace/` then `namespace/name/` then `namespace/name/version/`
// and see where the first error occurs.
let not_found = |msg| Err(PackageError::NotFound(spec.clone(), msg)); let not_found = |msg| Err(PackageError::NotFound(spec.clone(), msg));
let Some(packages_dir) = &self.package_path else { let Some(packages_dir) = &self.package_path else {
return not_found(eco_format!("cannot access local package storage")); return not_found(eco_format!("cannot access local package storage"));
}; };
// Fast path failed. Instead we try to diagnose the issue by going
// down the subdirectories of the expected path one at a time.
let namespace_dir = packages_dir.join(format!("{}", spec.namespace)); let namespace_dir = packages_dir.join(format!("{}", spec.namespace));
if !namespace_dir.exists() { if !namespace_dir.exists() {
return not_found(eco_format!( return not_found(eco_format!(