diff options
| author | John Turner <jturner.usa@gmail.com> | 2025-11-29 20:43:28 +0000 |
|---|---|---|
| committer | John Turner <jturner.usa@gmail.com> | 2025-11-29 20:50:59 +0000 |
| commit | d1127df296aa7871555293e324d125e6d8a843e1 (patch) | |
| tree | baddfab365df586207fa9c1dadf270ee94c3f46f /src/repo/mod.rs | |
| parent | 94f3397d197e47eb58a7391acd9c63c5565fa26e (diff) | |
| download | gentoo-utils-profiles.tar.gz | |
impl profile evaluationprofiles
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 { |
