summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorAllan McRae <allan@archlinux.org>2012-03-09 07:01:28 +0100
committerDan McGee <dan@archlinux.org>2012-03-16 18:00:42 +0100
commit03465ad6b6719e0afb20ca8829581190a2b7658e (patch)
treee5e536a6da44db1364c7bcd907d993248ba7c7b2 /scripts
parentd521f30f071e2bd2c39c05f39df34be867dfe572 (diff)
downloadpacman-03465ad6b6719e0afb20ca8829581190a2b7658e.tar.gz
pacman-03465ad6b6719e0afb20ca8829581190a2b7658e.tar.xz
makepkg: append pkgbase to BUILDDIR if specified
This means multiple packages can be build using the same BUILDDIR without their source files all ending up extracted in the same directory. Fixes FS#28417. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/makepkg.sh.in10
1 files changed, 8 insertions, 2 deletions
diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index 89cd118d..8763ffba 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -2061,8 +2061,6 @@ if [[ ! -w $BUILDDIR ]]; then
plain "$(gettext "Aborting...")"
exit 1
fi
-srcdir="$BUILDDIR/src"
-pkgdir="$BUILDDIR/pkg"
PKGDEST=${_PKGDEST:-$PKGDEST}
PKGDEST=${PKGDEST:-$startdir} #default to $startdir if undefined
@@ -2159,6 +2157,14 @@ fi
pkgbase=${pkgbase:-${pkgname[0]}}
epoch=${epoch:-0}
+if [[ $BUILDDIR = "$startdir" ]]; then
+ srcdir="$BUILDDIR/src"
+ pkgdir="$BUILDDIR/pkg"
+else
+ srcdir="$BUILDDIR/$pkgbase/src"
+ pkgdir="$BUILDDIR/$pkgbase/pkg"
+fi
+
if (( GENINTEG )); then
mkdir -p "$srcdir"
chmod a-s "$srcdir"