obs-service-tar_scm
obs-service-tar_scm copied to clipboard
How to define these kinds of version format in openSUSE Build Service
Hello, everyone! :smiley:
I am trying openSUSE Build Service recently, and encounter some problems in packaging for Arch Linux. How to write the file _service
to define these kinds of version format in OBS:
- [x] First one:
The source file is a Git repo, and the $pkgver
(the version string of the package) is defined as the output of
git describe --always | sed 's|-|.|g'
The example is goldendict-git , refer to https://aur.archlinux.org/packages/go/goldendict-git/PKGBUILD
The current $pkgver
is 1.5.0.RC.436.g450130c
I don't know how to write the file _service
to auto fill the $pkgver
so that OBS can update the $pkgver
automatically by executing osc service rr
.
This is what I'm writing:
<services>
<service name="tar_scm">
<param name="scm">git</param>
<param name="url">git://github.com/goldendict/goldendict.git</param>
<param name="versionformat">g%h</param>
<param name="versionprefix">1.5.0.RC.436</param>
<param name="filename">goldendict</param>
</service>
<service name="recompress">
<param name="file">*.tar</param>
<param name="compression">gz</param>
</service>
<service name="set_version"/>
</services>
- [ ] Second one:
The source file is a Git repo, and the $pkgver
is defined as the output of
printf "%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
The example is oh-my-zsh-git, refer to https://aur.archlinux.org/packages/oh/oh-my-zsh-git/PKGBUILD
The current $pkgver
is 2774.96e4e5d
I don't know how to write the file _service
to auto fill the $pkgver
so that OBS can update the $pkgver
automatically by executing osc service rr
.
This is what I'm writing:
<services>
<service name="tar_scm">
<param name="scm">git</param>
<param name="url">git://github.com/robbyrussell/oh-my-zsh.git</param>
<param name="versionformat">%h</param>
<param name="versionprefix">2774</param>
<param name="filename">oh-my-zsh</param>
</service>
<service name="recompress">
<param name="file">*.tar</param>
<param name="compression">gz</param>
</service>
<service name="set_version"/>
</services>
After searching for the Issues, I found that @matwey has opened a pull request https://github.com/openSUSE/obs-service-tar_scm/pull/26 about adding @REVISION@
(or @TAG_OFFSET@
in an appropriate way) to versionformat
. I think it's approach to my requirement. Maybe this issue would be a feature request which requests for something like @TAG_OFFSET@
.
Assuming that @TAG_OFFSET@
has been implemented, the first one could be
<param name="versionformat">@PARENT_TAG@.@[email protected]%h</param>
and the second one could be
<param name="versionformat">@TAG_OFFSET@.%h</param>
Any help is appreciated!
Yours sincerely :bow: