MCPcopy Create free account
hub / github.com/f0rr0/oliphaunt / archive_entries

Function archive_entries

xtask/src/main.rs:6461–6486  ·  view source on GitHub ↗
(path: &Path)

Source from the content-addressed store, hash-verified

6459}
6460
6461fn archive_entries(path: &Path) -> Result<HashSet<String>> {
6462 let file = fs::File::open(path).with_context(|| format!("open {}", path.display()))?;
6463 let decoder = zstd::stream::read::Decoder::new(file)
6464 .with_context(|| format!("decode {}", path.display()))?;
6465 let mut archive = tar::Archive::new(decoder);
6466 let mut entries = HashSet::new();
6467 for entry in archive
6468 .entries()
6469 .with_context(|| format!("read entries from {}", path.display()))?
6470 {
6471 let entry = entry.with_context(|| format!("read entry from {}", path.display()))?;
6472 let entry_path = entry
6473 .path()
6474 .with_context(|| format!("read entry path from {}", path.display()))?;
6475 let entry = entry_path
6476 .to_str()
6477 .ok_or_else(|| anyhow!("archive {} has non-UTF-8 path", path.display()))?
6478 .trim_start_matches("./")
6479 .trim_end_matches('/')
6480 .to_string();
6481 if !entry.is_empty() {
6482 entries.insert(entry);
6483 }
6484 }
6485 Ok(entries)
6486}
6487
6488fn audit_upstream_fixes(manifest: &SourcesManifest, strict: bool) -> Result<()> {
6489 let checkout = Path::new(POSTGRES_PGLITE_PATH);

Callers 2

Calls 2

insertMethod · 0.80
pathMethod · 0.45

Tested by

no test coverage detected