Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/scripts/makepkg.sh.in
diff options
context:
space:
mode:
authorAllan McRae <allan@archlinux.org>2008-10-28 22:04:39 +1000
committerDan McGee <dan@archlinux.org>2008-10-28 22:33:58 -0500
commit8d33dcb81c464f5e42d83078472bc509e087dd62 (patch)
tree2123ddf121233940cc03fe21016ed514ed1a6c1d /scripts/makepkg.sh.in
parentcd51abf0c8d04c72cc85b28cd45b33b9020c661e (diff)
makepkg: enable passing PKGBUILD from pipe
Do not attemp to update pkgver/pkgrel when reading a SCM based PKGBUILD from a pipe. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'scripts/makepkg.sh.in')
-rw-r--r--scripts/makepkg.sh.in12
1 files changed, 9 insertions, 3 deletions
diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index 266e214f..687897ee 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -1037,6 +1037,10 @@ devel_check() {
if [ "$HOLDVER" = "1" ]; then
return
fi
+ # Cannot update pkgver/pkgrel if reading PKGBUILD from pipe
+ if [ ! -f "./$BUILDSCRIPT" ]; then
+ return
+ fi
if [ "$FORCE_VER" = "" ]; then
# Check if this is a svn/cvs/etc PKGBUILD; set $newpkgver if so.
# This will only be used on the first call to makepkg; subsequent
@@ -1104,9 +1108,11 @@ devel_update() {
#
if [ "$newpkgver" != "" ]; then
if [ "$newpkgver" != "$pkgver" ]; then
- sed -i "s/^pkgver=[^ ]*/pkgver=$newpkgver/" ./$BUILDSCRIPT
- sed -i "s/^pkgrel=[^ ]*/pkgrel=1/" ./$BUILDSCRIPT
- source $BUILDSCRIPT
+ if [ -f "./$BUILDSCRIPT" ]; then
+ sed -i "s/^pkgver=[^ ]*/pkgver=$newpkgver/" ./$BUILDSCRIPT
+ sed -i "s/^pkgrel=[^ ]*/pkgrel=1/" ./$BUILDSCRIPT
+ source $BUILDSCRIPT
+ fi
fi
fi
}