[opensuse-buildservice] using custom variables with tar_scm
Hi, Is there a way to store the output of various commands ie "hg log" "hg parents" in a variable when using service files like tar_scm or set_version Thanks -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
On 2011-09-13 10:38:08 +0000, Togan Muftuoglu said:
Is there a way to store the output of various commands ie "hg log" "hg parents" in a variable when using service files like tar_scm or set_version
Writing/editing the source service scripts isn't particularly hard - but it requires you have root access on the OBS server. (Not a problem if you run your own OBS service like I do, but it's much more difficult if you're using build.opensuse.org). If you do have root access, you can modify (or better copy & modify) tar_scm so that it stores the output of your scm output ('hg log', etc.) in a file located in ${MYOUTDIR} - then the file becomes "known" to OBS as _service:tar_scm:somefile.txt. Of course, this assumes you have root access to the obs server. If nothting else, it may be instructive to look at the tar_scm source code (it's just a shell script) to understand how it works. I know with git, there is an auto versioning code path that puts the git commit sha1 in the tarball's version string. I imagine hg has something similar. -- Troy Telford -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
On 09/13/2011 08:58 PM, Troy Telford wrote:
On 2011-09-13 10:38:08 +0000, Togan Muftuoglu said:
Is there a way to store the output of various commands ie "hg log" "hg parents" in a variable when using service files like tar_scm or set_version
Writing/editing the source service scripts isn't particularly hard - but it requires you have root access on the OBS server. (Not a problem if you run your own OBS service like I do, but it's much more difficult if you're using build.opensuse.org).
I am using the build.opensuse.org and if I could find a way to pass things to the spec that would be great but I do not see a way changeset=\ 'hg parents --template 'Latest-tag:{latesttag},CSet:{rev}:{node|short}'' Togan -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
Am Dienstag, 13. September 2011, 12:58:33 schrieb Troy Telford:
On 2011-09-13 10:38:08 +0000, Togan Muftuoglu said:
Is there a way to store the output of various commands ie "hg log" "hg parents" in a variable when using service files like tar_scm or set_version
Writing/editing the source service scripts isn't particularly hard - but it requires you have root access on the OBS server. (Not a problem if you run your own OBS service like I do, but it's much more difficult if you're using build.opensuse.org).
If you do have root access, you can modify (or better copy & modify) tar_scm so that it stores the output of your scm output ('hg log', etc.) in a file located in ${MYOUTDIR} - then the file becomes "known" to OBS as _service:tar_scm:somefile.txt.
Of course, this assumes you have root access to the obs server.
Or just make a patch which makes general sense and we take it for the official obs-service packages :)
If nothting else, it may be instructive to look at the tar_scm source code (it's just a shell script) to understand how it works. I know with git, there is an auto versioning code path that puts the git commit sha1 in the tarball's version string. I imagine hg has something similar.
That is not such a good idea, because the version would not be steady increasing anymore. That will cause problems with rpm, zypper and friends. -- Adrian Schroeter SUSE Linux Products GmbH email: adrian@suse.de
participants (3)
-
Adrian Schröter
-
Togan Muftuoglu
-
Troy Telford