[pacman-dev] [PATCH] doc: Document pkgver() function

William Giokas 1007380 at gmail.com
Thu Apr 25 18:18:23 EDT 2013


On Thu, Apr 25, 2013 at 09:54:13PM +0000, Xyne wrote:
> On 2013-04-24 15:15 +1000
> Allan McRae wrote:
> 
> >On 23/04/13 17:15, William Giokas wrote:
> >> Originally from Jason St. John's patch, This is a much simplified
> >> version explaining some basic functions the four vcs's makepkg supports
> >> can use to get package version information.
> 
> /snip
> 
> >Also, note I added "Example commands" above so the we know these are
> >commands.  I'd put the command first (in the source block) and the
> >example output after.
> 
> I've seen pkgver functions for Git popping up that include hashtags in the
> version. I expect that this will become a widespread problem for vercmp-based
> ordering if it is not discouraged. Perhaps you can add a note about that in the
> documentation, e.g.

Git describe outputs a versionable string. If there are tags, it will
take the latest tag (usually a version, say 4.1.0), and combine it with
two more parts. The second part is the number of parents between the
named tag and the current HEAD. This makes the git describe so far
somethinglike::

    4.1.0-15

I usually call this part the revno, as it's similar to what other vcs's
use.

But now we get to the part you're talking about, which really doesn't
matter anymore, the hash. This I keep on the end to be sure of what
version was built.

I brought up a more complex sed command that can be used if upstream
uses tags like::

    1.8.1 -> 1.8.1.1 -> 1.8.2 -> 1.8.2.1

that adds a 'r' in front of the revno, so the original git describe
looks something like::

    4.1.0-15-g99b8d78

and after it's run through the sed command it will look like::

    4.1.0.15.g99b8d78
    (or alternately) 4.1.0.r15.g99b8d78

so it's completely versionable including the hash. The second version of
the git pkgvers that was in there works similar to other vcs's, using
the number of parents between the current HEAD and the initial commit::

    0.r5300.g99b8d78

The '0.r' allows a tag such as '0.1' to be greater than the current
version.

I am more worried about people using the date of the last commit, which
is just a stupid way to do it when you have one of these ways to get the
pkgver.

> "The pkgver function should generate a version string that is correctly ordered
> in all cases by Pacman's vercmp command. For example, Git hash tags should be
> avoided as these are pseudo-random. Refer to the vercmp man page for
> information about how Pacman orders different version strings."

I'll look at adding this to the pkgver description. I, however, think
that hashtags should be included at the very least.

-- 
William Giokas | KaiSforza
GnuPG Key: 0x73CD09CF
Fingerprint: F73F 50EF BBE2 9846 8306  E6B8 6902 06D8 73CD 09CF
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: <http://mailman.archlinux.org/pipermail/pacman-dev/attachments/20130425/65979112/attachment.asc>


More information about the pacman-dev mailing list