read deprecated file in profiles
This commit is contained in:
@@ -52,6 +52,7 @@ pub struct Profile {
|
||||
#[get(kind = "deref")]
|
||||
path: PathBuf,
|
||||
eapi: Option<Eapi>,
|
||||
deprecated: Option<String>,
|
||||
#[get(kind = "deref")]
|
||||
parents: Vec<Profile>,
|
||||
make_defaults: HashMap<String, String>,
|
||||
@@ -100,6 +101,13 @@ impl Profile {
|
||||
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 packages = packages::evaluate(&parents, &path)?;
|
||||
@@ -124,6 +132,7 @@ impl Profile {
|
||||
path: path.as_ref().to_path_buf(),
|
||||
parents,
|
||||
eapi,
|
||||
deprecated,
|
||||
make_defaults,
|
||||
packages,
|
||||
package_mask,
|
||||
|
||||
Reference in New Issue
Block a user