1
0
mirror of https://github.com/moparisthebest/pacman synced 2024-11-15 13:55:09 -05:00

makepkg: fix check for previously built packages with package splitting

Checks if some or all packages are built before overwriting/installing.
Adds some new strings for translation.

Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
Allan McRae 2009-07-02 13:53:29 +10:00
parent 617e7d512f
commit b312c820c8

View File

@ -1648,16 +1648,45 @@ if [ "${#pkgname[@]}" -gt "1" ]; then
SPLITPKG=1 SPLITPKG=1
fi fi
if [ -f "$PKGDEST/${pkgname}-${pkgver}-${pkgrel}-${CARCH}${PKGEXT}" \ if [ "$SPLITPKG" -eq 0 ]; then
-a "$FORCE" -eq 0 -a "$SOURCEONLY" -eq 0 -a "$NOBUILD" -eq 0 ]; then if [ -f "$PKGDEST/${pkgname}-${pkgver}-${pkgrel}-${CARCH}${PKGEXT}" \
if [ "$INSTALL" -eq 1 ]; then -a "$FORCE" -eq 0 -a "$SOURCEONLY" -eq 0 -a "$NOBUILD" -eq 0 ]; then
warning "$(gettext "A package has already been built, installing existing package...")" if [ "$INSTALL" -eq 1 ]; then
install_package warning "$(gettext "A package has already been built, installing existing package...")"
exit $? install_package
else exit $?
error "$(gettext "A package has already been built. (use -f to overwrite)")" else
exit 1 error "$(gettext "A package has already been built. (use -f to overwrite)")"
exit 1
fi
fi fi
else
allpkgbuilt=1
somepkgbuilt=0
for pkg in ${pkgname[@]}; do
if [ -f "$PKGDEST/${pkg}-${pkgver}-${pkgrel}-${CARCH}${PKGEXT}" ]; then
somepkgbuilt=1
else
allpkgbuilt=0
fi
done
if [ "$FORCE" -eq 0 -a "$SOURCEONLY" -eq 0 -a "$NOBUILD" -eq 0 ]; then
if [ "$allpkgbuilt" -eq 1 ]; then
if [ "$INSTALL" -eq 1 ]; then
warning "$(gettext "The package group has already been built, installing existing packages...")"
install_package
exit $?
else
error "$(gettext "The package group has already been built. (use -f to overwrite)")"
exit 1
fi
fi
if [ "$somepkgbuilt" -eq 1 ]; then
error "$(gettext "Part of the package group has already been built. (use -f to overwrite)")"
exit 1
fi
fi
unset allpkgbuilt somepkgbuilt
fi fi
# Run the bare minimum in fakeroot # Run the bare minimum in fakeroot