1 |
#! /bin/bash |
2 |
# |
3 |
# Giuseppe Vacanti (cosine) September 2000 |
4 |
# |
5 |
# $Id$ |
6 |
# |
7 |
set -e |
8 |
. $HOME/bin/ccflib.cfg |
9 |
|
10 |
saslatest > /dev/null |
11 |
|
12 |
list=`ls $ccfrepository/*CALINDEX*` |
13 |
if [ -z "$list" ] ; then |
14 |
next=1 |
15 |
else |
16 |
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 |
fi |
21 |
|
22 |
# format with leading zeroes |
23 |
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 |
cd $ccfrepository |
31 |
|
32 |
mif=XMM_CALINDEX_$next.CCF |
33 |
|
34 |
echo New MIF: $mif |
35 |
|
36 |
# build a new one |
37 |
cifbuild --fullpath=no --masterindex=yes --calindexset=$mif |
38 |
|
39 |
dssetattr --to=${mif}%ISSUE --type=int --value=$next |
40 |
dssetattr --to=${mif}%FILENAME --type=string --value=$mif |
41 |
ccfextseq --sets=$mif |
42 |
|