summaryrefslogtreecommitdiff
path: root/src/resolver.rs
diff options
context:
space:
mode:
authorqvkap <qvkapp@gmail.com>2026-10-01 07:25:04 +0300
committerqvkap <qvkapp@gmail.com>2026-10-01 07:26:37 +0300
commit49d816d9314379e80ec47c62385e404874eb2904 (patch)
tree56856d7c981c39ba0c99e09871345f75c95c6c97 /src/resolver.rs
parentd4db32e8b7edb41c40e0bcc947b9076520ec5d20 (diff)
downloadror-49d816d9314379e80ec47c62385e404874eb2904.tar.gz
ror-49d816d9314379e80ec47c62385e404874eb2904.zip
fix(rootfs,resolver): run ldconfig in sysroot, handle optional install steps, improve multi-init service deployment
Diffstat (limited to 'src/resolver.rs')
-rw-r--r--src/resolver.rs32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/resolver.rs b/src/resolver.rs
index 33c67e2..bee1681 100644
--- a/src/resolver.rs
+++ b/src/resolver.rs
@@ -255,6 +255,38 @@ pub fn check_conflicts(required: &HashSet<String>, installed_db: &InstalledDB) -
}
}
+ const STRICT_ROLES: &[&str] = &["init-system", "libc", "core-utils", "udev"];
+ for &role in STRICT_ROLES {
+ let mut providers_in_required = Vec::new();
+ for (name, pkg) in &pkg_map {
+ if pkg.provides.contains(&role.to_string()) {
+ providers_in_required.push(name.clone());
+ }
+ }
+ if providers_in_required.len() > 1 {
+ return Err(format!(
+ "CRITICAL: multiple packages in the transaction provide '{}': {}. Only one '{}' provider is allowed at once.",
+ role, providers_in_required.join(", "), role
+ ));
+ }
+
+ if let Some(cand) = providers_in_required.first() {
+ for (inst_name, _) in &installed_db.packages {
+ if inst_name == cand {
+ continue;
+ }
+ if let Some(inst_pkg) = load_package(inst_name) {
+ if inst_pkg.provides.contains(&role.to_string()) {
+ return Err(format!(
+ "CRITICAL: '{}' provides '{}', but '{}' is already installed and provides it. Multiple '{}' providers violate RorkOS system rules. Use 'ror di {} {}' to replace it atomically.",
+ cand, role, inst_name, role, inst_name, cand
+ ));
+ }
+ }
+ }
+ }
+ }
+
let names: Vec<_> = pkg_map.keys().cloned().collect();
for i in 0..names.len() {
for j in i + 1..names.len() {