(file) Return to setglobalhstags CVS log (file) (dir) Up to [Development] / JSOC / proj / globalhs / scripts

File: [Development] / JSOC / proj / globalhs / scripts / setglobalhstags (download)
Revision: 1.3, Wed May 18 19:49:33 2016 UTC (20 months ago) by arta
Branch: MAIN
CVS Tags: Ver_LATEST, Ver_9-1, Ver_9-0, Ver_8-12, Ver_8-11, HEAD
Changes since 1.2: +1 -0 lines
Make this executable.

#!/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