impl profile evaluation
This commit is contained in:
@@ -11,11 +11,15 @@ use mon::{Parser, ParserIter, ascii_whitespace1, input::InputIter, tag};
|
||||
use crate::{
|
||||
Parseable,
|
||||
atom::{self, Atom},
|
||||
repo::ebuild::{Depend, Eapi, Ebuild, Eclass, License, SrcUri},
|
||||
repo::{
|
||||
ebuild::{Depend, Eapi, Ebuild, Eclass, License, SrcUri},
|
||||
profile::Profile,
|
||||
},
|
||||
useflag::IUseFlag,
|
||||
};
|
||||
|
||||
pub mod ebuild;
|
||||
pub mod profile;
|
||||
|
||||
#[derive(Debug, thiserror::Error)]
|
||||
pub enum Error {
|
||||
@@ -27,6 +31,8 @@ pub enum Error {
|
||||
Unicode(PathBuf),
|
||||
#[error("parser error: {0}")]
|
||||
Parser(String),
|
||||
#[error("profile error: {0}")]
|
||||
Profile(profile::Error),
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Get)]
|
||||
@@ -63,6 +69,10 @@ impl Repo {
|
||||
fs::read_dir(&path).map_err(|e| Error::Io(path, e))?,
|
||||
))
|
||||
}
|
||||
|
||||
pub fn evaluate_profile<P: AsRef<Path>>(&self, path: P) -> Result<Profile, Error> {
|
||||
Profile::evaluate(self.path.join("profiles").join(path)).map_err(Error::Profile)
|
||||
}
|
||||
}
|
||||
|
||||
impl Category {
|
||||
|
||||
Reference in New Issue
Block a user