[pacman-dev] [PATCH] makepkg: don't try to verbump PKGBUILD on /dev/stdin

Allan McRae allan at archlinux.org
Sun Jul 10 19:10:12 EDT 2011


On 11/07/11 04:03, Dave Reisner wrote:
> 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 at 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.

The second resourcing is a must.  e.g. PKGBUILDs could have something 
like this:

pkgver=1.2.3
_basever=${pkgver%.*}

change pkgver...

Allan




More information about the pacman-dev mailing list