Skip to content

Commit e29e0f1

Browse files
committed
Ignore dependencies on upgrade and remove excess packages
There are new dependencies from elfutils and binutils which needs to be removed from the container. So we clean any packages not found in the buildinfo from the chroot. Signed-off-by: Morten Linderud <[email protected]>
1 parent ae0c17b commit e29e0f1

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

repro.in

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,14 @@ __END__
262262
msg "Installing packages"
263263
# shellcheck disable=SC2086
264264
exec_nspawn build --bind="$(readlink -e ${cachedir}):/cache" bash -c \
265-
'yes y | pacman -U --overwrite "*" -- "$@"' -bash "${packages[@]}"
265+
'yes y | pacman -Udd --overwrite "*" -- "$@"' -bash "${packages[@]}"
266+
267+
read -r -a buildinfo_packages <<< "$(buildinfo -f installed "${pkg}")"
268+
uninstall=$(comm -13 \
269+
<(printf '%s\n' "${buildinfo_packages[@]}" | rev | cut -d- -f4- | rev | sort) \
270+
<(exec_nspawn build --bind="$(readlink -e ${cachedir}):/cache" pacman -Qq))
271+
272+
exec_nspawn build pacman -Rdd --noconfirm -- $uninstall
266273

267274
build_package "build" "$builddir"
268275
remove_snapshot "build"

0 commit comments

Comments
 (0)