handle Manifest.gz files in repos
All checks were successful
Gentoo Utils / build-oci-image (push) Successful in 8s
Gentoo Utils / build (push) Successful in 32s
Gentoo Utils / build-oci-image (pull_request) Successful in 8s
Gentoo Utils / build (pull_request) Successful in 32s

This commit is contained in:
2025-12-08 22:18:39 +00:00
parent 217d80da7f
commit 0366c6234a

View File

@@ -1,5 +1,6 @@
use std::{
fs, io,
os::unix::ffi::OsStrExt,
path::{Path, PathBuf},
};
@@ -77,12 +78,15 @@ impl Iterator for Categories {
type Item = Result<Category, Error>;
fn next(&mut self) -> Option<Self::Item> {
match self.1.next()? {
Ok(entry) => match read_category(entry.path()) {
Ok(category) => Some(Ok(category)),
Err(e) => Some(Err(e)),
},
Err(e) => Some(Err(Error::ReadDir(self.0.clone(), e))),
loop {
match self.1.next()? {
Ok(entry) if entry.path().file_name().unwrap().as_bytes() == b"Manifest.gz" => (),
Ok(entry) => match read_category(entry.path()) {
Ok(category) => break Some(Ok(category)),
Err(e) => break Some(Err(e)),
},
Err(e) => break Some(Err(Error::ReadDir(self.0.clone(), e))),
}
}
}
}
@@ -91,12 +95,15 @@ impl Iterator for Ebuilds {
type Item = Result<Ebuild, Error>;
fn next(&mut self) -> Option<Self::Item> {
match self.1.next()? {
Ok(entry) => match read_ebuild(entry.path()) {
Ok(ebuild) => Some(Ok(ebuild)),
Err(e) => Some(Err(e)),
},
_ => todo!(),
loop {
match self.1.next()? {
Ok(entry) if entry.path().file_name().unwrap().as_bytes() == b"Manifest.gz" => (),
Ok(entry) => match read_ebuild(entry.path()) {
Ok(ebuild) => break Some(Ok(ebuild)),
Err(e) => break Some(Err(e)),
},
_ => todo!(),
}
}
}
}