Merge branch 'main' into review
This commit is contained in:
@@ -50,6 +50,7 @@ impl ToDoPerBackend {
|
||||
if packages.is_empty() {
|
||||
continue;
|
||||
}
|
||||
|
||||
let exit_status = func(&**backend, packages).with_context(|| {
|
||||
format!("{verb_continuous} packages for {}", backend.get_binary())
|
||||
})?;
|
||||
@@ -62,10 +63,6 @@ impl ToDoPerBackend {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub(crate) fn is_empty(&self) -> bool {
|
||||
self.0.iter().all(|(_, packages)| packages.is_empty())
|
||||
}
|
||||
|
||||
pub(crate) fn show(&self, keyword: Option<&str>) {
|
||||
for (backend, packages) in self.iter() {
|
||||
if packages.is_empty() {
|
||||
|
||||
+1
-1
@@ -171,7 +171,7 @@ impl Pacdef {
|
||||
fn clean_packages(mut self) -> Result<()> {
|
||||
let to_remove = self.get_unmanaged_packages();
|
||||
|
||||
if to_remove.is_empty() {
|
||||
if to_remove.nothing_to_do_for_all_backends() {
|
||||
println!("nothing to do");
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
@@ -44,6 +44,7 @@ pub(crate) fn review(
|
||||
) -> Result<()> {
|
||||
let mut reviews = ReviewsPerBackend::new();
|
||||
let mut groups: Vec<Rc<Group>> = groups.into_iter().map(Rc::new).collect();
|
||||
|
||||
groups.sort_unstable();
|
||||
|
||||
if todo_per_backend.nothing_to_do_for_all_backends() {
|
||||
@@ -136,6 +137,7 @@ fn ask_user_action_for_package() -> Result<ReviewIntention> {
|
||||
_ => Ok(ReviewIntention::Invalid),
|
||||
}
|
||||
}
|
||||
|
||||
fn print_enumerated_groups(groups: &[Rc<Group>]) {
|
||||
for (i, group) in groups.iter().enumerate() {
|
||||
println!("{i}: {}", group.name);
|
||||
@@ -160,6 +162,7 @@ fn ask_group(groups: &[Rc<Group>]) -> Result<Option<Rc<Group>>> {
|
||||
Ok(None)
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
struct Strategy {
|
||||
backend: Box<dyn Backend>,
|
||||
|
||||
Reference in New Issue
Block a user