--- a/virtualbox-guest-source.install +++ b/virtualbox-guest-source.install @@ -12,7 +12,10 @@ EOF # arg 1: the new package version # arg 2: the old package version pre_upgrade() { - pre_remove "$2" + local curver=${2%%-*} + # $2 is unset due to a bug. Query current version using pacman as fallback + [ -n "$curver" ] || curver=$(pacman -Qi virtualbox-guest-source | awk '/^Version/{print $3}') + pre_remove "$curver" } # arg 1: the new package version diff --git a/virtualbox-host-source.install b/virtualbox-host-source.install index 8028cb7..1096f7b 100644 --- a/virtualbox-host-source.install +++ b/virtualbox-host-source.install @@ -12,7 +12,10 @@ EOF # arg 1: the new package version # arg 2: the old package version pre_upgrade() { - pre_remove "$2" + local curver=${2%%-*} + # $2 is unset due to a bug. Query current version using pacman as fallback + [ -n "$curver" ] || curver=$(pacman -Qi virtualbox-host-source | awk '/^Version/{print $3}') + pre_remove "$curver" } # arg 1: the new package version