[arkdep] diff implement removed

This commit is contained in:
Dennis ten Hoove 2024-07-17 23:06:31 +02:00
parent a3de5259ed
commit d94cf565ef
No known key found for this signature in database
GPG key ID: 2BA91DC2563B83D1

16
arkdep
View file

@ -661,6 +661,15 @@ diff () {
done
done
# Find removed packages
for old_pkg in "${old_pkgs[@]}"; do
declare old_spaced=($old_pkg)
if [[ ! "${new_pkgs[@]}" =~ "${old_spaced[0]}" ]]; then
removed+=("${old_spaced[0]}")
fi
done
# Print changed packages and diff
if [[ $update_diff_style == 'list' ]]; then
num=0
@ -680,6 +689,13 @@ diff () {
done
fi
if [[ ${#removed[@]} -ne 0 ]]; then
printf '\nRemoved:\n'
for rem in "${removed[@]}"; do
printf " $rem\n"
done
fi
exit 0
}