1 |
ccflib |
1.1 |
#! /bin/bash |
2 |
|
|
# |
3 |
|
|
# Giuseppe Vacanti (cosine) September 2000 |
4 |
|
|
# |
5 |
ccflib |
1.4 |
# $Id$ |
6 |
ccflib |
1.3 |
# |
7 |
ccflib |
1.2 |
set -e |
8 |
ccflib |
1.1 |
. $HOME/bin/ccflib.cfg |
9 |
|
|
|
10 |
ccflib |
1.2 |
saslatest > /dev/null |
11 |
ccflib |
1.1 |
|
12 |
ccflib |
1.2 |
list=`ls $ccfrepository/*CALINDEX*` |
13 |
|
|
if [ -z "$list" ] ; then |
14 |
|
|
next=1 |
15 |
ccflib |
1.1 |
else |
16 |
ccflib |
1.2 |
n=`for f in $ccfrepository/*CALINDEX* ; do |
17 |
|
|
basename $f | cut -d_ -f 3 | cut -d. -f 1 |
18 |
|
|
done | sort -n -r | head -1 | sed -e 's/^0\{1,3\}//g'` |
19 |
|
|
next=$[n + 1] |
20 |
ccflib |
1.1 |
fi |
21 |
ccflib |
1.2 |
|
22 |
|
|
# format with leading zeroes |
23 |
ccflib |
1.1 |
next=`printf "%4.4d" $next` |
24 |
|
|
|
25 |
|
|
# remove old CALINDEX entries not to clog the system |
26 |
|
|
mv $ccfrepository/*CALINDEX* $ccfrepository/calindex |
27 |
|
|
|
28 |
|
|
export SAS_CCFPATH |
29 |
|
|
SAS_CCFPATH=$ccfrepository |
30 |
ccflib |
1.2 |
cd $ccfrepository |
31 |
ccflib |
1.1 |
|
32 |
ccflib |
1.2 |
mif=XMM_CALINDEX_$next.CCF |
33 |
ccflib |
1.1 |
|
34 |
ccflib |
1.2 |
echo New MIF: $mif |
35 |
ccflib |
1.1 |
|
36 |
ccflib |
1.2 |
# build a new one |
37 |
|
|
cifbuild --fullpath=no --masterindex=yes --calindexset=$mif |
38 |
ccflib |
1.1 |
|
39 |
ccflib |
1.2 |
dssetattr --to=${mif}%ISSUE --type=int --value=$next |
40 |
|
|
dssetattr --to=${mif}%FILENAME --type=string --value=$mif |
41 |
|
|
ccfextseq --sets=$mif |
42 |
ccflib |
1.1 |
|