diff --git a/src/package/install.rs b/src/package/install.rs index c6e64a1..0cf86d4 100644 --- a/src/package/install.rs +++ b/src/package/install.rs @@ -317,8 +317,12 @@ impl Installer { let symlink_path = &BIN_PATH.join(&package.pkg_name); if symlink_path.exists() { if let Ok(link) = symlink_path.read_link() { + if *install_path == link { + return Ok(()) + } if let Ok(parent) = link.strip_prefix(&*PACKAGES_PATH) { - let package_name = &parent.parent().unwrap().to_string_lossy()[9..]; + let package_path = parent.parent().unwrap().to_string_lossy(); + let package_name = &package_path[..8]; if package_name == package.full_name('-') { fs::remove_dir_all(link.parent().unwrap()).await?; diff --git a/src/registry/fetcher.rs b/src/registry/fetcher.rs index 80cfe16..3d39639 100644 --- a/src/registry/fetcher.rs +++ b/src/registry/fetcher.rs @@ -49,7 +49,7 @@ impl MetadataFetcher { .map(|(key, packages)| { let package_map: HashMap> = packages.iter().fold(HashMap::new(), |mut acc, package| { - acc.entry(package.pkg.clone()).or_default().push(Package { + acc.entry(package.pkg.to_lowercase().clone()).or_default().push(Package { family: package .download_url .split('/') diff --git a/src/registry/storage.rs b/src/registry/storage.rs index 2d8153f..6314e53 100644 --- a/src/registry/storage.rs +++ b/src/registry/storage.rs @@ -325,7 +325,7 @@ impl PackageStorage { .flat_map(|(collection_key, map)| { map.get(pkg_name).into_iter().flat_map(|pkgs| { pkgs.iter().filter_map(|pkg| { - if pkg.pkg == pkg_name + if pkg.pkg.to_lowercase() == pkg_name && (query.family.is_none() || pkg.family.as_ref() == query.family.as_ref()) {