[pacman-dev] [PATCH] Integrate versionpkg into makepkg
Aaron Griffin
aaronmgriffin at gmail.com
Fri Oct 26 15:23:32 EDT 2007
On 10/26/07, Scott Horowitz <stonecrest at gmail.com> wrote:
> I personally found it silly to have separate scripts for makepkg and
> versionpkg. I've seen countless messages on AUR where people ask for
> -svn PKGBUILDS to be updated because their pkgver is out of date, etc.
> Many people don't know about versionpkg and, even if you do, it makes
> sense to have a single script that handles both.
>
> Please look at the patch carefully because I am by no means a shell
> scripting expert. I tested it with mpd-svn and mpd PKGBUILDS; both
> worked fine but that hardly means everything is perfect.
Great idea. Personally, I've never looked at versionpkg, but I did
like the functionality of it.
I only have a few comments, which are probably more directed at
versionpkg itself.
> +update_pb() {
> + sed -i "1,11 s/pkgver=[^ ]*/pkgver=$1/" ./$BUILDSCRIPT
> +}
> +
The 1,11 scares me here. It seems kinda arbitrary. To me this seems better:
sed -i "s/^pkgver=[^ ]*/pkgver=$1/" ./$BUILDSCRIPT
But might also fail. I don't know, but the 1,11 choice is off-putting to me.
> +# This is lame, but if we're wanting to use an updated pkgver for
> +# retrieving svn/cvs/etc sources, we'll update the PKGBUILD, re-source
> +# it, and then revert it
> +if [ "$newpkgver" != "" ]; then
> + if [ "newpkgver" != "$pkgver" ]; then
> + oldpkgver=$pkgver
> + update_pb $newpkgver
> + source $BUILDSCRIPT
> + update_pb $oldpkgver
> + fi
> +fi
> +
Hmmm this scares me too. HOWEVER, if we're going to do this, wouldn't
it be smarter to actually NOT revert to the old version and maybe
output something?
More information about the pacman-dev
mailing list