[pacman-dev] [PATCH] Revise PKGBUILD(5), document pkgver() in PKGBUILD(5), and update example PKGBUILD

William Giokas 1007380 at gmail.com
Mon Apr 8 21:09:40 EDT 2013


On Tue, Apr 09, 2013 at 11:05:14AM +1000, Allan McRae wrote:
> On 09/04/13 09:46, Jason St. John wrote:
> > From: "Jason St. John" <jstjohn at purdue.edu>
> I really do not think these are warranted in the man page.

I was actually thinking that there could be a series of manual pages in
the abs, 'PKGBUILD-git.5' (and the rest) that contained things like
this, listing the nuances and things to do with the specific VCS's. Just
an idea, especially if the protos are going away.

> 
> > +*Git*::
> > +	*Using the tag of the last commit*;;
> > +		Example result: 4.1.0
> > +
> > +		pkgver() {
> > +			cd local_repo
> > +			git describe --always | sed 's|-|.|g'
> > +		}
> > +
> > +	*Using the total count of commits and the tag of the last commit*;;
> > +		Example result: 0.1142.2.0.6
> > +
> > +		pkgver() {
> > +			cd local_repo
> > +			echo "0.$(git rev-list --count HEAD).$(git describe --always)"
> > +		}
> > +
> > +	*Using the last commit date*;;
> > +		Example result: 20130108
> > +
> > +		pkgver() {
> > +			cd local_repo
> > +			git log -1 --format="%cd" --date=short | tr -d '-'
> > +		}
> > +
> > +	*Using the amount of seconds between the last commit and the Unix epoch*;;
> > +		Example result: 1358182650
> > +
> > +		pkgver() {
> > +			cd local_repo
> > +			git log -1 --format=%cd --date=raw | cut -d " " -f1
> > +		}
> > +
> > +*Subversion*::
> > +	Example result: 8546
> > +
> > +	pkgver() {
> > +		cd "$SRCDEST"/local_repo
> > +		svnversion | tr -d [A-z]
> > +	}
> > +
> > +*Mercurial*::
> > +	Example result: 2813.75881cc5391e
> > +
> > +	pkgver() {
> > +		cd local_repo
> > +		hg identify -ni | awk 'BEGIN{OFS=".";} {print $2,$1}'
> > +	}
> > +
> > +*Bazaar*::
> > +	Example result: 830
> > +
> > +	pkgver() {
> > +		cd local_repo
> > +		bzr revno
> > +	}
> > +
> > +*Fallback*::
> > +	If no acceptable version information can be extracted from the
> > +	repository, use the current date.
> > +	Example result: 20130408
> > +
> > +	pkgver() {
> > +		date +%Y%m%d
> > +	}
> > +
> > +
> >  Example
> >  -------
> >  The following is an example PKGBUILD for the 'patch' package. For more
> > 
> 
> 

-- 
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/20130408/9deca5e5/attachment.asc>


More information about the pacman-dev mailing list