![]() ![]() |
![]() |
File: [Development] / JSOC / proj / globalhs / scripts / setglobalhstags
(download)
Revision: 1.2, Fri Jan 17 00:48:54 2014 UTC (9 years, 4 months ago) by tplarson Branch: MAIN CVS Tags: Ver_8-8, Ver_8-7, Ver_8-6, Ver_8-5, Ver_8-4, Ver_8-3, Ver_8-10 Changes since 1.1: +33 -24 lines now run only a single cvs command to reduce run time and require user input |
#!/bin/tcsh cd $JSOCROOT set tmpfile = `mktemp` set stat = 0 cvs -q status -v proj/globalhs/apps proj/globalhs/libs > $tmpfile set statlist = `grep "^File:" $tmpfile | awk '{print $4}'` set nfiles = $#statlist set i=1 while ($i <= $nfiles) if ($statlist[$i] != Up-to-date) then echo some files are out of date exit 1 endif @ i++ end set headerlines = `grep -n = $tmpfile | cut -d: -f1` #initialize taglist with tag of last file set taglist = `sed -n $headerlines[$nfiles],\$'p' $tmpfile | grep -v Sticky | grep globalhs_ | awk '{print $1}' | sort -t "_" -k 3 -n | tail -1` set i=1 while ($i < $nfiles) set line1 = $headerlines[$i] @ j = $i + 1 set line2 = $headerlines[$j] set tag = `sed -n $line1,$line2'p' $tmpfile | grep -v Sticky | grep globalhs_ | awk '{print $1}' | sort -t "_" -k 3 -n | tail -1` set taglist = ($taglist $tag) @ i++ end set curver = `echo $taglist | sed s/" "/"\n"/g | sort -t "_" -k 3 -n | tail -1 | cut -d_ -f3` @ newver = $curver + 1 if ($status) then echo incorrect format for current highest version number exit 1 endif set newtag = globalhs_version_$newver echo New tag will be $newtag. This will be applied to every file "\n"in globalhs/apps and globalhs/libs. echo -n Proceed\? \(anything other than \'yes\' aborts\)' ' set test = $< if ($test == yes) then cd $JSOCROOT/proj/globalhs cvs tag -c $newtag apps/ libs/ set stat = $status echo cvs tag ran with exit status $stat. else echo Aborted. set stat = -1 endif rm $tmpfile exit $stat
Karen Tian |
Powered by ViewCVS 0.9.4 |