Closed rinon closed 5 years ago
I believe your fix will break if there are multiple matching files. For instance, I have PKGDEST=$HOME/packages
set in my /etc/makepkg.conf
. As a result I have a lot of old packages in there:
$ ls chromium-pepper-flash*
chromium-pepper-flash-1:15.0.0.223-1-x86_64.pkg.tar.xz
chromium-pepper-flash-1:15.0.0.223-2-x86_64.pkg.tar.xz
chromium-pepper-flash-1:15.0.0.239-1-x86_64.pkg.tar.xz
chromium-pepper-flash-1:16.0.0.235-1-x86_64.pkg.tar.xz
chromium-pepper-flash-1:16.0.0.235-2-x86_64.pkg.tar.xz
Instead, my suggested fix is:
$ diff /usr/bin/packer my_packer
339c339,340
< pkgtarfiles="$pkgtarfiles $i-$pkgver-$pkgrel*$PKGEXT"
---
> [[ $epoch ]] && epoch="$epoch:"
> pkgtarfiles="$pkgtarfiles $i-$epoch$pkgver-$pkgrel*$PKGEXT"
makepkg does it like this:
get_full_version() {
if (( epoch > 0 )); then
printf "%s\n" "$epoch:$pkgver-$pkgrel"
else
printf "%s\n" "$pkgver-$pkgrel"
fi
}
and
pkglist+=("$PKGDEST/${pkg}-${fullver}-${pkgarch}${PKGEXT}")
It might be better to actually handle the full file path including all possible options that makepkg throws in. However, this simple patch allows packages with epochs to actually build and install. Please fix this ASAP...