diff options
Diffstat (limited to 'src/repo/mod.rs')
| -rw-r--r-- | src/repo/mod.rs | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/repo/mod.rs b/src/repo/mod.rs index 46dd895..eb769f8 100644 --- a/src/repo/mod.rs +++ b/src/repo/mod.rs @@ -10,11 +10,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 { @@ -26,6 +30,8 @@ pub enum Error { Unicode(PathBuf), #[error("parser error: {0}")] Parser(String), + #[error("profile error: {0}")] + Profile(profile::Error), } #[derive(Debug, Clone, Get)] @@ -62,6 +68,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 { |
