FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > ArchLinux > ArchLinux Pacman Development

 
 
LinkBack Thread Tools
 
Old 07-10-2011, 06:03 PM
Dave Reisner
 
Default makepkg: don't try to verbump PKGBUILD on /dev/stdin

This works around an edge case where we try to change the $pkgver and
$pkgrel of a VCS PKGBUILD passed in standard input, which fails on
missing write permissions in /dev.

As an added bonus, we avoid a second (costly) full re-sourcing of the
PKGBUILD, and simply reassign the variables that may have changed to
ensure that in the non-write case we create the new package with the
correct version.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
---
Extreme edge cases ftw.

Allan, correct me if I'm wrong that this is the only place where we actually
modify the PKGBUILD itself. I had myself a grep around and couldn't find
anything else -- I just want to make sure I'm not going to hit some crazy
pitfall by avoiding the second resourcing. I did do some simple testing and all
seems to be well, but you probably know this portion of the code better than I
do.

scripts/makepkg.sh.in | 11 ++++++++---
1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index 1b132a9..e77ca51 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -1623,9 +1623,14 @@ devel_update() {
if [[ -n $newpkgver ]]; then
if [[ $newpkgver != $pkgver ]]; then
if [[ -f $BUILDFILE && -w $BUILDFILE ]]; then
- @SEDINPLACE@ "s/^pkgver=[^ ]*/pkgver=$newpkgver/" "$BUILDFILE"
- @SEDINPLACE@ "s/^pkgrel=[^ ]*/pkgrel=1/" "$BUILDFILE"
- source "$BUILDFILE"
+ if [[ -w "${BUILDFILE%/*}" ]]; then
+ @SEDINPLACE@ "s/^pkgver=[^ ]*/pkgver=$newpkgver/" "$BUILDFILE"
+ @SEDINPLACE@ "s/^pkgrel=[^ ]*/pkgrel=1/" "$BUILDFILE"
+ else
+ warning "$(gettext "Unable to update PKGBUILD package version")"
+ fi
+ pkgver=$newpkgver
+ pkgrel=1
fi
fi
fi
--
1.7.6
 

Thread Tools




All times are GMT. The time now is 04:31 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org