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

File: [Development] / JSOC / proj / globalhs / scripts / checkglobalhstags (download)
Revision: 1.7, Thu Mar 20 17:30:05 2014 UTC (4 years, 8 months ago) by tplarson
Branch: MAIN
CVS Tags: Ver_LATEST, Ver_9-2, Ver_9-1, Ver_9-0, Ver_8-8, Ver_8-7, Ver_8-6, Ver_8-5, Ver_8-4, Ver_8-12, Ver_8-11, Ver_8-10, HEAD
Changes since 1.6: +2 -0 lines
now remove tmp file when check fails

#!/bin/tcsh

if ($#argv != 1) then
  echo must specify root of source directory as first argument
  exit 1
endif

set srcdir=$1
set tmpfile = `mktemp`

cd $srcdir
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
    rm $tmpfile
    exit 1
  endif
@ i++
end

set headerlines = `grep -n = $tmpfile | cut -d: -f1`

#get tag of last file
set revision = `sed -n $headerlines[$nfiles],\$'p' $tmpfile | grep "Working revision:" | awk '{print $3}'`
set tag1 = `sed -n $headerlines[$nfiles],\$'p' $tmpfile | grep "revision: $revision" | 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 revision = `sed -n $line1,$line2'p' $tmpfile | grep "Working revision:" | awk '{print $3}'`
  set tag = `sed -n $line1,$line2'p' $tmpfile | grep "revision: $revision" | grep -v Sticky | grep globalhs | awk '{print $1}' | sort -t "_" -k 3 -n | tail -1`
  if ($tag != $tag1) then
    echo tags are mixed
    rm $tmpfile
    exit 1
  endif
@ i++
end

rm $tmpfile
echo $tag
exit 0

Karen Tian
Powered by
ViewCVS 0.9.4