[pacman-dev] [PATCH] Integrate versionpkg into makepkg

Scott Horowitz stonecrest at gmail.com
Fri Oct 26 15:40:34 EDT 2007


On 10/26/07, Aaron Griffin <aaronmgriffin at gmail.com> wrote:
>
> 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.

How might it fail? And yes, that function is pretty much directly from
versionpkg..

> > +# 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?

I don't mind if we don't revert it, but versionpkg currently reverts
it. There certainly seems to be no harm in not reverting it...

I don't think there's any alternative to updating the PKGBUILD and
re-sourcing it because you can have something like the mpd-svn
PKGBUILD where:
pkgver=4596
...
_revnumber=$pkgver

If not for this kind of strangeness/stupidity, you could easily just
set pkgver in makepkg itself...

Also, I've attached the patch because some of the lines were too long
and wrapped..

Scott
-------------- next part --------------
A non-text attachment was scrubbed...
Name: makepkg_versionpkg.patch
Type: text/x-diff
Size: 4083 bytes
Desc: not available
URL: <http://archlinux.org/pipermail/pacman-dev/attachments/20071026/1946e232/attachment.bin>


More information about the pacman-dev mailing list