Am Dienstag, 13. September 2011, 16:09:14 schrieb Troy Telford:
A modified tar_scm that uses a 'cfgterm' that is searched for in the obs project config.
It's a little hackish, but it's an example of what you can do. This way, it's possible to have the same _service file in:
well, I can't import it in this form at least, since breaks current setups. (not supporting --revision anymore)
some_project
and
home:ttelford:some_project
due to differences in the 'cfgterm', the end result can be very different - because it's pulling from an entirely different scm branch. It makes it a lot easier to have multiple developers, each working on their own piece of the code
To set up a new user, it just takes a loop of 'osc copy' and one 'osc meta prjconf'. It's a lot less work than modifying the _service file in x packages each time there's a new user.
I can't follow you here. The purpose of the _service file is that the generation of the sources is reproducable by everybody in the same way. And this code makes it dependend now on local configurations ? Why should it be needed to modify a _service file when a new user gets added ? Because each user works in his own branch ? But which branch gets built on the server then ? bye adrian
--- tar_scm 2011-09-13 13:40:51.873444973 -0600 +++ tar_scm_branch 2011-09-13 16:03:25.665728335 -0600 @@ -19,6 +19,7 @@ MYREVISION="" MYPACKAGEMETA="" MYGITARGS="--depth 1" +PROJECT=""
while test $# -gt 0; do case $1 in @@ -34,8 +35,8 @@ MYSUBDIR="$2" shift ;; - *-revision) - MYREVISION="$2" + *-cfgterm) + CFGTERM="$2" shift ;; *-version) @@ -83,6 +84,27 @@ shift done
+# Get the actual revision from the configuration file(s): +# Verify config file exists: +if [[ -f /srv/obs/projects/${PROJECT}.conf ]] +then + if [[ ! -z ${CFGTERM} ]] + then + MYREVISION=$(cat /srv/obs/projects/${PROJECT}.conf | grep -E ${CFGTERM} | awk '{print $2}') + if [[ -z MYREVISION ]] + then + echo "Revision search term not found." + exit 1 + fi + else + echo "Config search term not defined!" + exit 1 + fi +else + echo "project config for ${PROJECT} does not exist." + exit 1 +fi + FILE="$MYFILENAME" VERSION="$MYVERSION" if [ -z "$MYPACKAGEMETA" ]; then
-- Adrian Schroeter SUSE Linux Products GmbH email: adrian@suse.de