If a pkgver() function is specified, always build the package even
if a package with the current pkgver is found as this pkgver may
change.
The only exception is when installing with -i. If a new build is
required then, -f must be used.
Signed-off-by: Allan McRae <allan@archlinux.org>
---
I thought this was a reasonable compromise in terms of complexity
and what I would expect makepkg to do. Having makepkg download
all the sources, update pkgver, then check if a package with the same
pkgver is already built did not seem the right approach to me.
- if declare -f pkgver >/dev/null && (( GET_VCS )); then
+ if (( PKGVERFUNC && GET_VCS )); then
update_pkgver
check_pkgver || exit 1
fi
@@ -1807,7 +1808,7 @@ check_sanity() {
ret=1
fi
- if ! declare -f pkgver >/dev/null; then
+ if (( ! PKGVERFUNC )) ; then
check_pkgver || ret=1
fi
@@ -2406,6 +2407,10 @@ if (( GENINTEG )); then
exit 0 # $E_OK
fi
+if declare -f pkgver >/dev/null; then
+ PKGVERFUNC=1
+fi
+
# check the PKGBUILD for some basic requirements
check_sanity || exit 1
@@ -2482,12 +2487,12 @@ else
warning "$(gettext "The package group has already been built, installing existing packages...")"
install_package
exit $?
- else
+ elif (( ! PKGVERFUNC )); then
error "$(gettext "The package group has already been built. (use %s to overwrite)")" "-f"
exit 1
fi
fi
- if (( somepkgbuilt )); then
+ if (( somepkgbuilt && ! PKGVERFUNC )); then
error "$(gettext "Part of the package group has already been built. (use %s to overwrite)")" "-f"
exit 1
fi
--
1.7.11.2