mirror of
https://github.com/pesde-pkg/pesde.git
synced 2025-04-07 04:10:55 +01:00
refactor: rename PackageFs::CAS to Cas
The name now fits in with the rest of the codebase.
This commit is contained in:
parent
2154fc0e84
commit
ca550eee3a
5 changed files with 7 additions and 7 deletions
|
@ -294,7 +294,7 @@ impl PruneCommand {
|
||||||
let mut removed_packages = 0usize;
|
let mut removed_packages = 0usize;
|
||||||
|
|
||||||
'entry: for (path, fs) in cas_entries {
|
'entry: for (path, fs) in cas_entries {
|
||||||
let PackageFs::CAS(entries) = fs else {
|
let PackageFs::Cas(entries) = fs else {
|
||||||
continue;
|
continue;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -36,7 +36,7 @@ pub enum FsEntry {
|
||||||
#[serde(untagged)]
|
#[serde(untagged)]
|
||||||
pub enum PackageFs {
|
pub enum PackageFs {
|
||||||
/// A package stored in the CAS
|
/// A package stored in the CAS
|
||||||
CAS(BTreeMap<RelativePathBuf, FsEntry>),
|
Cas(BTreeMap<RelativePathBuf, FsEntry>),
|
||||||
/// A package that's to be copied
|
/// A package that's to be copied
|
||||||
Copy(PathBuf, TargetKind),
|
Copy(PathBuf, TargetKind),
|
||||||
}
|
}
|
||||||
|
@ -240,7 +240,7 @@ impl PackageFs {
|
||||||
link: bool,
|
link: bool,
|
||||||
) -> std::io::Result<()> {
|
) -> std::io::Result<()> {
|
||||||
match self {
|
match self {
|
||||||
PackageFs::CAS(entries) => {
|
PackageFs::Cas(entries) => {
|
||||||
package_fs_cas(
|
package_fs_cas(
|
||||||
entries.clone(),
|
entries.clone(),
|
||||||
destination.as_ref(),
|
destination.as_ref(),
|
||||||
|
@ -262,7 +262,7 @@ impl PackageFs {
|
||||||
file_hash: H,
|
file_hash: H,
|
||||||
cas_dir_path: P,
|
cas_dir_path: P,
|
||||||
) -> Option<String> {
|
) -> Option<String> {
|
||||||
if !matches!(self, PackageFs::CAS(_)) {
|
if !matches!(self, PackageFs::Cas(_)) {
|
||||||
return None;
|
return None;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -481,7 +481,7 @@ impl PackageSource for GitPackageSource {
|
||||||
entries.insert(path, entry);
|
entries.insert(path, entry);
|
||||||
}
|
}
|
||||||
|
|
||||||
let fs = PackageFs::CAS(entries);
|
let fs = PackageFs::Cas(entries);
|
||||||
|
|
||||||
if let Some(parent) = index_file.parent() {
|
if let Some(parent) = index_file.parent() {
|
||||||
fs::create_dir_all(parent).await?;
|
fs::create_dir_all(parent).await?;
|
||||||
|
|
|
@ -276,7 +276,7 @@ impl PackageSource for PesdePackageSource {
|
||||||
entries.insert(path, FsEntry::File(hash));
|
entries.insert(path, FsEntry::File(hash));
|
||||||
}
|
}
|
||||||
|
|
||||||
let fs = PackageFs::CAS(entries);
|
let fs = PackageFs::Cas(entries);
|
||||||
|
|
||||||
if let Some(parent) = index_file.parent() {
|
if let Some(parent) = index_file.parent() {
|
||||||
fs::create_dir_all(parent)
|
fs::create_dir_all(parent)
|
||||||
|
|
|
@ -312,7 +312,7 @@ impl PackageSource for WallyPackageSource {
|
||||||
entries.insert(relative_path, FsEntry::File(hash));
|
entries.insert(relative_path, FsEntry::File(hash));
|
||||||
}
|
}
|
||||||
|
|
||||||
let fs = PackageFs::CAS(entries);
|
let fs = PackageFs::Cas(entries);
|
||||||
|
|
||||||
if let Some(parent) = index_file.parent() {
|
if let Some(parent) = index_file.parent() {
|
||||||
fs::create_dir_all(parent)
|
fs::create_dir_all(parent)
|
||||||
|
|
Loading…
Add table
Reference in a new issue