Skip to content

Commit

Permalink
match conda with .state.json -> .info.json (#377)
Browse files Browse the repository at this point in the history
Conda has been using `.info.json` for a few releases now.

My edits to the draft CEP are expressed in
https://github.com/conda-incubator/ceps/pull/48/files

I noticed rattler is back to using `.lock` files copied from what cargo
does, instead of the (has plenty of its own problems) record locking
found in mamba.
  • Loading branch information
dholth authored Oct 12, 2023
1 parent feba547 commit 9e98be3
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion crates/rattler_repodata_gateway/src/fetch/cache/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use serde_with::serde_as;
use std::{fs::File, io::Read, path::Path, str::FromStr, time::SystemTime};
use url::Url;

/// Representation of the `.state.json` file alongside a `repodata.json` file.
/// Representation of the `.info.json` file alongside a `repodata.json` file.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct RepoDataState {
/// The URL from where the repodata was downloaded. This is the URL of the `repodata.json`,
Expand Down
2 changes: 1 addition & 1 deletion crates/rattler_repodata_gateway/src/fetch/jlap/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
//! &current_repo_data
//! ).await.unwrap();
//!
//! // Now we can use the `updated_jlap_state` object to update our `.state.json` file
//! // Now we can use the `updated_jlap_state` object to update our `.info.json` file
//! }
//! ```
//!
Expand Down
4 changes: 2 additions & 2 deletions crates/rattler_repodata_gateway/src/fetch/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ pub async fn fetch_repo_data(
.expect("file name is valid"),
);
let repo_data_json_path = cache_path.join(format!("{}.json", cache_key));
let cache_state_path = cache_path.join(format!("{}.state.json", cache_key));
let cache_state_path = cache_path.join(format!("{}.info.json", cache_key));

// Lock all files that have to do with that cache key
let lock_file_path = cache_path.join(format!("{}.lock", &cache_key));
Expand Down Expand Up @@ -867,7 +867,7 @@ fn validate_cached_state(
cache_key: &str,
) -> ValidatedCacheState {
let repo_data_json_path = cache_path.join(format!("{}.json", cache_key));
let cache_state_path = cache_path.join(format!("{}.state.json", cache_key));
let cache_state_path = cache_path.join(format!("{}.info.json", cache_key));

// Check if we have cached repodata.json file
let json_metadata = match std::fs::metadata(&repo_data_json_path) {
Expand Down

0 comments on commit 9e98be3

Please sign in to comment.