proudzhu wrote:Hyphens is not allowed in pkgver, so "0.9.1.2-8-g833fd3f.31403fc" could not be used.
You can just find where the hyphens come from, and addsed 's|-|.|g'
to use dots instead of hyphens
bad idea
1.2.1 is greater tha 1.2.0 right?
but whit this a 2.0-299 become 2.0.299 and a 2.0.1-299 become 2.0.1.299
who is bigger, 2.0.299 or 2.0.1.299? vercmp say the firstI actually use
sed 's|-|.git|g'
and for now work as expeted making 2.0.git299 lower than 2.0.1.git299
and not sure what is the oppinion of dev about .r vs .git por git versions like that because for me adding .git mean git and .r is release like any common upstream release
Also a bad idea (or at least not really ideal), you'd actually end up with end up with 2.0.1.git299.gitg833fd3f. KaiSforza, who's been doing a lot of work on pacman, proposes this: https://wiki.archlinux.org/index.php/Ta … .28.29.27s. It adds "r" after the first occurrence of "-" only. Personally, I would use awk if there was a chance you'd run into this situation. git describe --long | awk -F - '{print $1 ".r" $2 "." $3}'
]]>I'm not sure I get all this, but doesn't `git rev-list --count HEAD` provide the propper sequential commit number?
In my git PKGBUILDS I use the following:
pkgver() { cd "${_gitname}"; echo "2.$(git rev-list --count HEAD).$(git describe --always )" }
Where the initial "2." can be any version prefix. In this case, this is a development version of the second major version and it provides sequential minor version numbers followed by non-sequential minor-minor version numbers, but this is fine as every change increments the minor version:
2.223.<hash>
2.224.<hash>
2.225.<hash>
...
Yes it does, but "git describe" already includes a count, so "git rev-list --count" isn't needed here.
]]>In my git PKGBUILDS I use the following:
pkgver() {
cd "${_gitname}";
echo "2.$(git rev-list --count HEAD).$(git describe --always )"
}
Where the initial "2." can be any version prefix. In this case, this is a development version of the second major version and it provides sequential minor version numbers followed by non-sequential minor-minor version numbers, but this is fine as every change increments the minor version:
2.223.<hash>
2.224.<hash>
2.225.<hash>
...
Hyphens is not allowed in pkgver, so "0.9.1.2-8-g833fd3f.31403fc" could not be used.
You can just find where the hyphens come from, and addsed 's|-|.|g'
to use dots instead of hyphens
bad idea
1.2.1 is greater tha 1.2.0 right?
but whit this a 2.0-299 become 2.0.299 and a 2.0.1-299 become 2.0.1.299
who is bigger, 2.0.299 or 2.0.1.299? vercmp say the first
I actually use
sed 's|-|.git|g'
and for now work as expeted making 2.0.git299 lower than 2.0.1.git299
and not sure what is the oppinion of dev about .r vs .git por git versions like that because for me adding .git mean git and .r is release like any common upstream release
]]>This is the final code for PKGBUILD:
# Maintainer: Cody Dostal <dostalcody@gmail.com>
pkgname=wifiz
_gitname=WiFiz
pkgver=0.9.2.8.gc38cae9
pkgrel=2
pkgdesc="NetCTL GUI Frontend, written in wxPython. Stable Version."
arch=('any')
url="https://github.com/codywd/WiFiz"
license=('MIT')
depends=('python2' 'wxpython' 'wireless_tools' 'netctl'
'wpa_supplicant')
makedepends=('git')
optdepends=('gedit: Manually editing profiles.')
conflicts=('wifiz-nightly')
provides=('wifiz')
source=('git://github.com/codywd/WiFiz.git#branch=develop')
# Because the sources are not static, skip Git checksum:
md5sums=('SKIP')
pkgver() {
cd "$_gitname"
echo $(git describe --long | sed 's/-/./g')
}
package() {
cd $srcdir/$_gitname
pwd
python2 setup.py install --root="$pkgdir/" --optimize=1
}
first off, git describe already includes the short hash of the commit, get rid of git rev-parse. echo $(git describe --long | sed 's/-/./g') is really all you need.
second, you don't really want what you say you want. "wifiz-0.9.2.g2d3e0a8-1-any.pkg.tar.xz" will not give you a linear versioning. The next commit could give you "wifiz-0.9.2.g19ab453-1-any.pkg.tar.xz", which would then be interpreted as a downgrade because the version number is less than the previous one. Having the count of commits in there is important to advance the version on each update.
Ahh, thanks for that...now I understand the rationale behind the wiki entry! So obvious in hindsight....
Scott
]]>pkgver() {
cd "$_gitname"
echo $(git describe --tags).$(git rev-parse --short develop) |
sed 's|-|.|g'
}
Thank you!
However, is there any way to remove the extraneous .s?
Like, here is the package name: wifiz-0.9.2.3.g2d3e0a8.-1-any.pkg.tar.xz
I would like it to be something like: "wifiz-0.9.2.g2d3e0a8-1-any.pkg.tar.xz" preferably, but "wifiz-0.9.2.3.g2d3e0a8-1-any.pkg.tar.xz" would be fine.
sed 's|-|.|g'
to use dots instead of hyphens
]]>==> Updated version: wifiz 0.9.2-2-g833fd3f.-1
==> ERROR: pkgver is not allowed to contain colons, hyphens or whitespace.
The PKGBUILD:
# Maintainer: Cody Dostal <dostalcody@gmail.com>
pkgname=wifiz
_gitname=WiFiz
pkgver=0.9.1.2-8-g833fd3f.31403fc
pkgrel=1
pkgdesc="NetCTL GUI Frontend, written in wxPython. Stable Version."
arch=('any')
url="https://github.com/codywd/WiFiz"
license=('MIT')
depends=('python2' 'wxpython' 'wireless_tools' 'netctl'
'wpa_supplicant')
makedepends=('git')
conflicts=('wifiz-nightly')
provides=('wifiz')
source=('git://github.com/codywd/WiFiz.git#branch=develop')
# Because the sources are not static, skip Git checksum:
md5sums=('SKIP')
pkgver() {
cd "$_gitname"
echo $(git describe --tags).$(git rev-parse --short master)
}
package() {
cd $srcdir/$_gitname
pwd
python2 setup.py install --root="$pkgdir/" --optimize=1
}
What causes the hyphens?
]]>pkgver() {
cd "$_gitname"
echo $(git describe --tags).$(git rev-parse --short master)
}
Scott
]]>For example, the current version number of my program is 0.9.2. The git commit number f2b19c0752. I would like the version number to be something like 0.9.2.f2b19c0752 in the PKGBUILD.
Also, why is PKGBUILD pkgver come out as pkgver=6620271 when the last commit was 36d9ff82ec?
Thanks in advance
]]>