From 062d313d00f43e42846ffe0ef07401bcde769bfe Mon Sep 17 00:00:00 2001 From: Xavier Moffett Date: Wed, 18 Sep 2024 19:45:51 -0400 Subject: [PATCH] Fix apply_configuration function Accidental removal of filter call leading to a regression, which output the full package list for each container configuration. The original intention was to remove a conditional statement from the filter. --- pacwrap-core/src/sync/transaction.rs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/pacwrap-core/src/sync/transaction.rs b/pacwrap-core/src/sync/transaction.rs index e64c0d3..446497d 100644 --- a/pacwrap-core/src/sync/transaction.rs +++ b/pacwrap-core/src/sync/transaction.rs @@ -483,7 +483,16 @@ impl<'a> TransactionHandle<'a> { fn apply_configuration(&mut self, instance: &ContainerHandle, create: bool) -> Result<()> { let depends = instance.metadata().dependencies(); let explicit_packages: Vec<&str> = instance.metadata().explicit_packages(); - let pkgs = self.alpm.as_mut().expect("ALPM").localdb().pkgs().iter().map(|p| p.name()).collect(); + let pkgs = self + .alpm + .as_mut() + .expect("ALPM handle") + .localdb() + .pkgs() + .iter() + .filter(|p| p.reason() == PackageReason::Explicit && !self.meta.foreign_pkgs.contains(p.name())) + .map(|p| p.name()) + .collect(); if pkgs != explicit_packages || create { let mut instance = instance.clone();