diff options
author | Allan McRae <allan@archlinux.org> | 2009-07-02 13:53:29 +1000 |
---|---|---|
committer | Allan McRae <allan@archlinux.org> | 2009-07-10 16:29:58 +1000 |
commit | b312c820c8c8ed98a8b8f927b948bca8a3a22632 (patch) | |
tree | 58babab59a366a75e9b152a7078c64a0b0b59761 /scripts | |
parent | 617e7d512ff6fb7d6c5e5232091b528148cc40c7 (diff) | |
download | pacman-b312c820c8c8ed98a8b8f927b948bca8a3a22632.tar.xz |
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>
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/makepkg.sh.in | 47 |
1 files changed, 38 insertions, 9 deletions
diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index 34e156ae..f931a65a 100644 --- a/scripts/makepkg.sh.in +++ b/scripts/makepkg.sh.in @@ -1648,16 +1648,45 @@ if [ "${#pkgname[@]}" -gt "1" ]; then SPLITPKG=1 fi -if [ -f "$PKGDEST/${pkgname}-${pkgver}-${pkgrel}-${CARCH}${PKGEXT}" \ - -a "$FORCE" -eq 0 -a "$SOURCEONLY" -eq 0 -a "$NOBUILD" -eq 0 ]; then - if [ "$INSTALL" -eq 1 ]; then - warning "$(gettext "A package has already been built, installing existing package...")" - install_package - exit $? - else - error "$(gettext "A package has already been built. (use -f to overwrite)")" - exit 1 +if [ "$SPLITPKG" -eq 0 ]; then + if [ -f "$PKGDEST/${pkgname}-${pkgver}-${pkgrel}-${CARCH}${PKGEXT}" \ + -a "$FORCE" -eq 0 -a "$SOURCEONLY" -eq 0 -a "$NOBUILD" -eq 0 ]; then + if [ "$INSTALL" -eq 1 ]; then + warning "$(gettext "A package has already been built, installing existing package...")" + install_package + exit $? + else + error "$(gettext "A package has already been built. (use -f to overwrite)")" + exit 1 + 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 # Run the bare minimum in fakeroot |