From d286909fb3aed959d935460e2a3591a8d18a1662 Mon Sep 17 00:00:00 2001 From: John Turner Date: Thu, 11 Dec 2025 02:00:40 +0000 Subject: [PATCH] read deprecated file in profiles --- src/repo/profile/mod.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/repo/profile/mod.rs b/src/repo/profile/mod.rs index edbc880..4736444 100644 --- a/src/repo/profile/mod.rs +++ b/src/repo/profile/mod.rs @@ -52,6 +52,7 @@ pub struct Profile { #[get(kind = "deref")] path: PathBuf, eapi: Option, + deprecated: Option, #[get(kind = "deref")] parents: Vec, make_defaults: HashMap, @@ -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,