/[CCFs]/bin/updatemif
ViewVC logotype

Diff of /bin/updatemif

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by ccflib, Mon Feb 18 20:23:57 2002 UTC revision 1.2 by ccflib, Tue Mar 19 15:05:10 2002 UTC
# Line 2  Line 2 
2  #  #
3  # Giuseppe Vacanti (cosine) September 2000  # Giuseppe Vacanti (cosine) September 2000
4  #  #
5    set -e
6  . $HOME/bin/ccflib.cfg  . $HOME/bin/ccflib.cfg
7    
8  # run only if there is something new  saslatest > /dev/null
 ls $ccfrepository/*.CCF | fgrep -v CALINDEX > $HOME/todaysccflist  
 if ( cmp -s $HOME/todaysccflist $HOME/yesterdaysccflist ) then  
 exit  
 fi  
 mv -f $HOME/todaysccflist $HOME/yesterdaysccflist  
   
   
 sasexperiment > /dev/null  
9    
10  if [ $# -eq 1 ] ; then  list=`ls $ccfrepository/*CALINDEX*`
11    next=$1  if [ -z "$list" ] ; then
12      next=1
13  else  else
14    list=`ls $ccfrepository/*CALINDEX*`    n=`for f in $ccfrepository/*CALINDEX* ; do
15    if [ -z "$list" ] ; then       basename $f | cut -d_ -f 3 | cut -d. -f 1
16      next=1       done | sort -n -r | head -1 | sed -e 's/^0\{1,3\}//g'`
17    else    next=$[n + 1]
     n=`for f in $ccfrepository/*CALINDEX* ; do  
        basename $f | cut -d_ -f 3 | cut -d. -f 1  
        done | sort -n -r | head -1 | sed -e 's/^0\{1,3\}//g'`  
     next=$[n + 1]  
   fi  
18  fi  fi
19    
20    # format with leading zeroes
21  next=`printf "%4.4d" $next`  next=`printf "%4.4d" $next`
22    
23  # remove old CALINDEX entries not to clog the system  # remove old CALINDEX entries not to clog the system
# Line 34  mv $ccfrepository/*CALINDEX* $ccfreposit Line 25  mv $ccfrepository/*CALINDEX* $ccfreposit
25    
26  export SAS_CCFPATH  export SAS_CCFPATH
27  SAS_CCFPATH=$ccfrepository  SAS_CCFPATH=$ccfrepository
28  # build a new one  cd $ccfrepository
 cifbuild --fullpath=no --masterindex=yes --calindexset=$ccfrepository/XMM_CALINDEX_$next.CCF  
29    
30  # this will contain the last CALINDEX as well  mif=XMM_CALINDEX_$next.CCF
 cifbuild  --fullpath=no --masterindex=yes --calindexset=$ccfrepository/ccf.mif  
31    
32  # rename it  echo New MIF: $mif
 mv $ccfrepository/ccf.mif $ccfrepository/XMM_CALINDEX_$next.CCF  
 dssetattr --to=ccf_repository/XMM_CALINDEX_$next.CCF%ISSUE --type=int --value=$next  
 dssetattr --to=ccf_repository/XMM_CALINDEX_$next.CCF%FILENAME --type=string --value=XMM_CALINDEX_$next.CCF  
33    
34  # create one with full path for local use  # build a new one
35  cifbuild  --fullpath=yes --masterindex=yes --calindexset=$ccfrepository/ccf.mif  cifbuild --fullpath=no --masterindex=yes --calindexset=$mif
36    
37  # update latest CIFs  dssetattr --to=${mif}%ISSUE --type=int --value=$next
38  latestcif  dssetattr --to=${mif}%FILENAME --type=string --value=$mif
39    ccfextseq --sets=$mif
40    

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

  ViewVC Help
Powered by ViewVC 1.1.27