Skip to content

Commit

Permalink
repro: reinstall packages with dependency ordering
Browse files Browse the repository at this point in the history
-Udd removes dependency ordering on installation, so there can be
post_install hooks failing as the dependency simply isn't present at the
time of the execution. Reinstalling ensures this doesn't happen.

Originally written by Allan McRae

Signed-off-by: Morten Linderud <[email protected]>
  • Loading branch information
Foxboron committed Jun 6, 2020
1 parent 5896d79 commit 086c8e6
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions repro.in
Original file line number Diff line number Diff line change
Expand Up @@ -374,19 +374,11 @@ __END__

if [ -n "$uninstall" ]; then
exec_nspawn "$build" pacman -Rdd --noconfirm -- $uninstall

# We might encounter issues where packages has been renamed, and we overwrote the files
# This causes pacman to remove .so-names beliving it belongs to the package we removed
# This fixes any messed up packages as reported by -Qqk
# Note: ++ is removed because DEBUG gets injected into stderr
fixup=$(exec_nspawn "$build" pacman -Qqk 2>&1 | grep -v "^++" | awk '{print $1}' | uniq) || true
if [ -n "$fixup" ]; then
fixup_packages=$(echo $fixup| tr ' ' '\0' | xargs -0 -n1 -I{} bash -c "printf -- '%s\n' ${packages[*]} | grep {}")
exec_nspawn "$build" --bind="$(readlink -e ${cachedir}):/cache" bash -c \
'yes y | pacman -Udd -- "$@"' -bash ${fixup_packages}
fi
fi

# reinstall all packages - fixes overwritten files and installs with correct dependency order
exec_nspawn "$build" --bind="$(readlink -e ${cachedir}):/cache" pacman -U --noconfirm -- "${packages[@]}"

build_package "$build" "$builddir"
remove_snapshot "$build"
chown -R "$src_owner" "${cachedir}"
Expand Down

0 comments on commit 086c8e6

Please sign in to comment.