Skip to content

Commit

Permalink
fix PR
Browse files Browse the repository at this point in the history
  • Loading branch information
wolfv committed Feb 9, 2024
1 parent 521111c commit 80f811d
Show file tree
Hide file tree
Showing 4 changed files with 101 additions and 117 deletions.
12 changes: 7 additions & 5 deletions crates/rattler/src/install/driver.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use super::clobber_registry::ClobberRegistry;
use super::unlink::recursively_remove_empty_directories;
use super::unlink::{recursively_remove_empty_directories, UnlinkError};
use super::{InstallError, Transaction};
use futures::stream::FuturesUnordered;
use futures::{FutureExt, StreamExt};
Expand Down Expand Up @@ -166,7 +166,10 @@ impl InstallDriver {
let required_packages =
PackageRecord::sort_topologically(prefix_records.iter().collect::<Vec<_>>());

self.remove_empty_directories(transaction, &prefix_records, target_prefix)?;
self.remove_empty_directories(transaction, &prefix_records, target_prefix)
.unwrap_or_else(|e| {
tracing::warn!("Failed to remove empty directories: {} (ignored)", e);
});

self.clobber_registry()
.unclobber(&required_packages, target_prefix)
Expand All @@ -181,7 +184,7 @@ impl InstallDriver {
transaction: &Transaction<PrefixRecord, RepoDataRecord>,
new_prefix_records: &[PrefixRecord],
target_prefix: &Path,
) -> Result<(), InstallError> {
) -> Result<(), UnlinkError> {
let mut keep_directories = HashSet::new();

// find all forced directories in the prefix records
Expand Down Expand Up @@ -218,8 +221,7 @@ impl InstallDriver {
target_prefix,
is_python_noarch,
&keep_directories,
)
.unwrap();
)?;

// The directory is not empty which means our parent directory is also not empty,
// recursively remove the parent directory from the set as well.
Expand Down
4 changes: 0 additions & 4 deletions crates/rattler/src/install/unlink.rs
Original file line number Diff line number Diff line change
Expand Up @@ -185,10 +185,6 @@ mod tests {
let prefix_record =
PrefixRecord::from_repodata_record(repodata_record, None, None, paths, None, None);

// install_driver
// .post_process(transaction, target_prefix)
// .unwrap();

return prefix_record;
}

Expand Down
Loading

0 comments on commit 80f811d

Please sign in to comment.