From: Aleš Křenek Date: Thu, 8 Jul 2010 14:29:03 +0000 (+0000) Subject: tagging wrapper script for gridsite X-Git-Tag: glite-jobid-api-c_R_1_0_5_1~29 X-Git-Url: http://scientific.zcu.cz/git/?a=commitdiff_plain;h=d3ba756701d9e38f0d258280deb376970a2bdf15;p=jra1mw.git tagging wrapper script for gridsite --- diff --git a/org.glite.lb/etics-tag-gridsite.pl b/org.glite.lb/etics-tag-gridsite.pl new file mode 100644 index 0000000..b2efbc3 --- /dev/null +++ b/org.glite.lb/etics-tag-gridsite.pl @@ -0,0 +1,195 @@ +#!/usr/bin/perl +# +# Copyright (c) Members of the EGEE Collaboration. 2004-2010. +# See http://www.eu-egee.org/partners for details on the copyright holders. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +use Getopt::Std; +use Switch; +use File::Basename; + +$TMPDIR=$ENV{'TMPDIR'}; +$GLITE_LB_LOCATION=dirname $0; + +if ($TMPDIR eq "") {$TMPDIR="/tmp";} + +getopts('i:c:m:gh'); + +$module='org.gridsite.core'; + +$usage = qq{ +usage: $0 -c + -c Use this configuration (\d+\.\d+\.\d+-\S+) + -h Display this help + +}; + +# ********************************** +# Interpret cmdline options +# ********************************** + +if (defined $opt_h) {die $usage}; +die $usage unless $module; + + +if (defined $opt_c) { + + # ********************************** + # Parse the tag supplied by the user + # ********************************** + + if ($opt_c=~/(\d+)\.(\d+)\.(\d+)-(\S+?)/) { + $major=$1; + $minor=$2; + $revision=$3; + $age=$4; + } + else {die ("tag not stated properly")}; +} +else { + die $usage; +} + +printf("Tag: $tag\n\tprefix: $prefix\n\t major: $major\n\t minor: $minor\n\t rev: $revision\n\t age: $age\n"); + + +# ********************************** +# Create the execution script +# ********************************** + +open EXEC, ">", "$TMPDIR/etics-tag-gridsite.$major.$minor.$revision-$age.sh" or die $!; + +printf (EXEC "#This script registers tags for the $module module, version $major.$minor.$revision-$age\n#Generated automatically by $0\n\n"); + +# ********************************** +# Update version.properties +# ********************************** + +## printf(EXEC "#Generate new version.properties\ncat >$module/project/version.properties <$TMPDIR/$subsysname-${mod}_R_$version.ini.$$"; + print CONF $conf; + close CONF; + + print EXEC "etics-configuration add -i $TMPDIR/$subsysname-${mod}_R_$version.ini.$$\n"; +} + +printf(EXEC "etics-commit\n"); + +open CONF,">$TMPDIR/${subsysname}_R_$version.ini.$$"; + +print CONF qq{ +[Configuration-gridsite_R_$version] +profile = None +moduleName = org.gridsite +displayName = gridsite_R_$version +description = gridsite_R_$version +projectName = org.glite +age = $age +vcsroot = None +tag = None +version = $major.$minor.$revision +path = None + +[Hierarchy] +org.gridsite.apache = gridsite-apache_R_$version +org.gridsite.shared = gridsite-shared_R_$version +org.gridsite.commands = gridsite-commands_R_$version +org.gridsite.core = gridsite-core_R_$version +}; + +close CONF; + +print EXEC "etics-configuration add -i $TMPDIR/${subsysname}_R_$version.ini.$$\n"; + +printf(EXEC "etics-commit\n"); + + +# ********************************** +# Final bows +# ********************************** + +close(EXEC); + +system("chmod +x \"$TMPDIR/etics-tag-gridsite.$major.$minor.$revision-$age.sh\""); + +printf("\n\n---------\nDone!\n\nExecution script written in:\t$TMPDIR/etics-tag-gridsite.$major.$minor.$revision-$age.sh\n"); +printf("New configuration written in:\t$TMPDIR/${subsysname}_R_$version.ini.$$\n\n"); +