summaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs24
1 files changed, 11 insertions, 13 deletions
diff --git a/src/main.rs b/src/main.rs
index 5b93b66..75e2920 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -18,6 +18,7 @@ mod debug;
mod search;
mod repo;
mod progress;
+mod check;
#[derive(Parser, Debug)]
#[command(author, about, arg_required_else_help = true)]
@@ -51,7 +52,7 @@ struct Args {
#[arg(long = "dry-run")]
dry_run: bool,
-
+
#[arg(short = 'u', long = "upgrade")]
upgrade: bool,
@@ -84,6 +85,9 @@ struct Args {
#[arg(long = "lg", alias = "listgroups")]
listgroups: bool,
+
+ #[arg(long = "check")]
+ check: bool,
}
fn run_di(del_pkg: String, inst_pkg: String, cfg: Arc<config::Config>) {
@@ -296,18 +300,8 @@ fn main() {
}
if args.upgrade {
- match cfg.profile.group_name() {
- Some(name) => {
- let recipe = PathBuf::from(format!("/var/ror/packages/groups/{}.yaml", name));
- println!("{} Upgrading via profile group: {}", "[ror]".blue().bold(), name.cyan());
- update::rebuild_from_recipe(&recipe, &cfg);
- }
- None => {
- eprintln!(
- "{} No system profile in ror.conf. Use --up <group> to set a profile first.",
- "[ror]".red().bold()
- );
- }
+ if let Err(e) = update::upgrade_system(&cfg) {
+ eprintln!("{} Upgrade failed: {}", "[ror]".red().bold(), e);
}
return;
}
@@ -365,4 +359,8 @@ fn main() {
group::list_groups();
return;
}
+ if args.check {
+ check::check_integrity(&cfg);
+ return;
+ }
}