read deprecated file in profiles
This commit is contained in:
@@ -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,
|
||||||
|
|||||||
Reference in New Issue
Block a user