[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Git Package Versioning



On Sun, 20 Mar 2011 22:25:38 +0100, Joachim Wiedorn <ad_debian@joonet.de> wrote:

> 
> Please be aware, that "+" is not the optimal connector.
> Try dpkg --compare-versions and see:

[snip] 

> The version b) is the better way. So please use "~" 
> as connector.

That rather depends on your goal. If the version number is before the
current snapshot, then + is appropriate.

I like to use the output of git-describe, along with sed, something like
the following:

,----
| SOURCEPKG=$(shell dpkg-parsechangelog | sed  -n 's/^Source: \(.*\)/\1/p')
| UPSTREAM=$(shell dpkg-parsechangelog |  sed -n 's/^Version: \(.*\)-[^-]*/\1/p')
| SHA1=$(lastword $(subst ~g, ,$(UPSTREAM)))
| ORIG=${SOURCEPKG}_${UPSTREAM}.orig.tar.gz
| 
| describe-current-version:
| 	git describe --tags upstream | sed 's,^release-,,;s,-,+,;s,-,~,;'
| 
| get-orig-source:
| 	git archive --format=tar $(SHA1) | gzip -9 > ../$(ORIG)
`----

The output from ./debian/rules describe-current-version is pasted into
debian/changelog, and it makes things like

                  0.7.1+706~g1157b91-1

So here + really makes sense because it is 706 commits after tag
release-0.7.1

The second ~ could be a + as well, doesn't matter.

Your mileage, may, as they say, vary.

d


Reply to: