@@ 21,8 21,8 @@ fn arch_in(def: &HashSet<String>, arch: &str) -> bool {
}
/// builds a single package without checking the dependencies
-fn build_package(name: PackageName, db: &Database, arch: &Option<String>, verbose:bool) {
- let pkg = db.packages.get(&name).expect("Package not found");
+fn build_package(name: &str, db: &Database, arch: &Option<String>, verbose:bool) {
+ let pkg = db.packages.get(name).expect("Package not found");
let mut child = Command::new("sh");
@@ 80,7 80,10 @@ fn build_group(name: PackageName, db: &Database, arch: &Option<String>, verbose:
let tasks = super::tree::topological_sort(&name, &db)
.expect("Unable to resolve dependencies, as there is a cycle in the graph");
- for task in tasks {
+ let num = tasks.len();
+
+ for (i, task) in tasks.iter().enumerate() {
+ println!("Building {} ({}/{})", task, i+1, num);
build_package(task, db, arch, verbose);
}
}
@@ 94,6 97,6 @@ pub fn build(name: PackageName, db: Option<PathBuf>, arch: Option<String>, build
// dependency resolution
build_group(name, &db, &arch, verbose);
} else {
- build_package(name, &db, &arch, verbose);
+ build_package(&name, &db, &arch, verbose);
}
}
@@ 38,6 38,7 @@ enum Commands {
/// package database path
#[arg(short='d',long)]
db: Option<PathBuf>,
+ /// allows the build log to be toggled on and off
#[arg(short='v', default_value="false")]
verbose: bool
},