read deprecated file in profiles
All checks were successful
Gentoo Utils / build-oci-image (pull_request) Successful in 8s
Gentoo Utils / build (pull_request) Successful in 35s

This commit is contained in:
2025-12-11 02:00:40 +00:00
parent ccf45347c4
commit ce113dd0c4

View File

@@ -52,6 +52,7 @@ pub struct Profile {
#[get(kind = "deref")] #[get(kind = "deref")]
path: PathBuf, path: PathBuf,
eapi: Option<Eapi>, eapi: Option<Eapi>,
deprecated: Option<String>,
#[get(kind = "deref")] #[get(kind = "deref")]
parents: Vec<Profile>, parents: Vec<Profile>,
make_defaults: HashMap<String, String>, make_defaults: HashMap<String, String>,
@@ -100,6 +101,13 @@ impl Profile {
Err(e) => return Err(Error::Io(eapi_path, e)), Err(e) => return Err(Error::Io(eapi_path, e)),
}; };
let deprecated_path = path.as_ref().join("deprecated");
let deprecated = match fs::read_to_string(&deprecated_path) {
Ok(string) => Some(string),
Err(e) if matches!(e.kind(), io::ErrorKind::NotFound) => None,
Err(e) => return Err(Error::Io(deprecated_path, e)),
};
let make_defaults = make_defaults::evaluate(&parents, &path)?; let make_defaults = make_defaults::evaluate(&parents, &path)?;
let packages = packages::evaluate(&parents, &path)?; let packages = packages::evaluate(&parents, &path)?;
@@ -124,6 +132,7 @@ impl Profile {
path: path.as_ref().to_path_buf(), path: path.as_ref().to_path_buf(),
parents, parents,
eapi, eapi,
deprecated,
make_defaults, make_defaults,
packages, packages,
package_mask, package_mask,