summaryrefslogtreecommitdiff
path: root/src/update.rs
diff options
context:
space:
mode:
authorrorka900 <rorka900@gmail.com>2026-04-24 17:53:49 +0300
committerrorka900 <rorka900@gmail.com>2026-04-24 17:53:49 +0300
commit9c9ce088193c2506da372c76685076bbfead0690 (patch)
tree8eacd30624a4d6da552f8de44a1e1273bfede3d4 /src/update.rs
parentf2ab400fb6750fbe017309757f06339437b7c4b8 (diff)
downloadror-9c9ce088193c2506da372c76685076bbfead0690.tar.gz
ror-9c9ce088193c2506da372c76685076bbfead0690.zip
feat: modernize CLI with clap subcommands and add declarative apply1.0.0-r1
Diffstat (limited to 'src/update.rs')
-rw-r--r--src/update.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/update.rs b/src/update.rs
index 5deb228..9703d7a 100644
--- a/src/update.rs
+++ b/src/update.rs
@@ -40,7 +40,9 @@ pub fn upgrade_system(cfg: &config::Config) -> Result<(), String> {
upgradable.join(", ").yellow()
);
- parallel::install_packages_parallel(&upgradable, Arc::new(cfg.clone()))
+ let rt = tokio::runtime::Runtime::new()
+ .map_err(|e| format!("Failed to create async runtime: {}", e))?;
+ rt.block_on(parallel::install_packages_parallel(&upgradable, Arc::new(cfg.clone())))
}
fn is_newer(current: &str, available: &str) -> bool {
@@ -86,6 +88,7 @@ pub fn update_package(pkg_name: &str, cfg: &config::Config, dry_run: bool) -> bo
true
}
+#[allow(dead_code)]
pub fn resolve_recipe_path(name_or_path: &Path) -> PathBuf {
if name_or_path.exists() {
return name_or_path.to_path_buf();
@@ -100,6 +103,7 @@ pub fn resolve_recipe_path(name_or_path: &Path) -> PathBuf {
name_or_path.to_path_buf()
}
+#[allow(dead_code)]
pub fn rebuild_from_recipe(recipe_path: &Path, cfg: &config::Config) {
let resolved = resolve_recipe_path(recipe_path);