Skip to content

Commit

Permalink
Mark registry excluded from block_until_ready
Browse files Browse the repository at this point in the history
  • Loading branch information
sourcefrog committed Apr 24, 2022
1 parent ce9a6ab commit 7191fc0
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions src/cargo/sources/registry/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -554,18 +554,6 @@ impl<'cfg> RegistrySource<'cfg> {
Box::new(remote::RemoteRegistry::new(source_id, config, &name)) as Box<_>
};

// Before starting to work on the registry, make sure that
// `<cargo_home>/registry` is marked as excluded from indexing and
// backups. Older versions of Cargo didn't do this, so we do it here
// regardless of whether `<cargo_home>` exists.
//
// This does not use `create_dir_all_excluded_from_backups_atomic` for
// the same reason: we want to exclude it even if the directory already
// exists.
let registry_base = config.registry_base_path();
registry_base.create_dir()?;
exclude_from_backups_and_indexing(&registry_base.into_path_unlocked())?;

Ok(RegistrySource::new(
source_id,
config,
Expand Down Expand Up @@ -826,6 +814,18 @@ impl<'cfg> Source for RegistrySource<'cfg> {
}

fn block_until_ready(&mut self) -> CargoResult<()> {
// Before starting to work on the registry, make sure that
// `<cargo_home>/registry` is marked as excluded from indexing and
// backups. Older versions of Cargo didn't do this, so we do it here
// regardless of whether `<cargo_home>` exists.
//
// This does not use `create_dir_all_excluded_from_backups_atomic` for
// the same reason: we want to exclude it even if the directory already
// exists.
let registry_base = self.config.registry_base_path();
registry_base.create_dir()?;
exclude_from_backups_and_indexing(&registry_base.into_path_unlocked())?;

self.ops.block_until_ready()
}
}
Expand Down

0 comments on commit 7191fc0

Please sign in to comment.