1996-05-16 00:52:17 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
1996-05-16 01:49:42 +00:00
|
|
|
# The directory in which to find the last snapshot
|
|
|
|
dir=../releases
|
|
|
|
|
|
|
|
# The email addresses of people to receive mail about the new diff
|
1996-05-16 00:52:17 +00:00
|
|
|
diff_recipients=drepper
|
|
|
|
|
1996-05-16 01:49:42 +00:00
|
|
|
# The name of this module
|
|
|
|
module=gstep-base
|
|
|
|
# A regular expression for the six-digit date string "yymmdd"
|
1996-05-16 00:52:17 +00:00
|
|
|
yrptn='[0-9][0-9][0-9][0-9][0-9][0-9]'
|
1996-05-16 01:49:42 +00:00
|
|
|
# The pattern for the file containing the diff
|
1996-05-16 00:52:17 +00:00
|
|
|
ptn="${module}-${yrptn}"
|
|
|
|
dptn="${ptn}-${yrptn}.diff"
|
|
|
|
|
1996-05-16 01:49:42 +00:00
|
|
|
# Get the current date
|
1996-05-16 00:52:17 +00:00
|
|
|
date=`date +%y%m%d`
|
|
|
|
|
1996-05-16 01:49:42 +00:00
|
|
|
# Find date of the last snapshot
|
1996-05-16 00:52:17 +00:00
|
|
|
lastsnap=`cd $dir; ls $ptn.tar.gz $dptn $dptn.gz 2>/dev/null |
|
|
|
|
sed -e "s/^.*\\(${yrptn}\\)[.a-z]*$/\\1/" |
|
|
|
|
sort -nr | head -1`
|
|
|
|
|
1996-05-16 01:49:42 +00:00
|
|
|
# Find the date of the last diff
|
1996-05-16 00:52:17 +00:00
|
|
|
lastdiff=`cd $dir; ls $dptn $dptn.gz 2>/dev/null |
|
|
|
|
sed -e "s/^.*\\(${yrptn}\\)[.a-z]*$/\\1/" |
|
|
|
|
sort -nr | head -1`
|
|
|
|
|
1996-05-16 01:49:42 +00:00
|
|
|
# Will we make a CVS tag for this snapshot? An empty value means `tag it'.
|
|
|
|
# Always disabled for now.
|
|
|
|
notag=yes
|
1996-05-16 00:52:17 +00:00
|
|
|
|
|
|
|
if [ $lastsnap = $date ]; then
|
|
|
|
if [ $lastdiff = $lastsnap ]; then
|
1996-05-16 01:49:42 +00:00
|
|
|
echo "$0: Snapshot diff for ${module}-${date} already made, skipping."
|
1996-05-16 00:52:17 +00:00
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
|
|
|
# There is already a full snapshot for this date, but no diffs.
|
|
|
|
# Don't re-tag, just make diffs.
|
|
|
|
notag=yes
|
|
|
|
lastsnap=$lastdiff
|
|
|
|
fi
|
|
|
|
|
1996-05-16 01:49:42 +00:00
|
|
|
# The name of the diff file
|
1996-05-16 00:52:17 +00:00
|
|
|
diff="${module}-${lastdiff}-${date}.diff"
|
1996-05-16 01:49:42 +00:00
|
|
|
echo Making $diff
|
|
|
|
|
|
|
|
# If $notag is empty, `cvs rtag' the repository
|
|
|
|
#test -z "$notag" && cvs -q rtag -F snapshot-$date $module
|
|
|
|
|
|
|
|
# Have cvs make the diff for us.
|
|
|
|
#cvs -q rdiff -u -r snapshot-$lastdiff -r snapshot-$date $module >$diff || exit
|
|
|
|
cvs rdiff -u -r snapshot-$lastdiff $module > $diff || exit
|
1996-05-16 00:52:17 +00:00
|
|
|
|
|
|
|
if [ -s $diff ]; then
|
1996-05-16 01:49:42 +00:00
|
|
|
# Mail a message saying the new diff is available. (Commented out for now)
|
|
|
|
# mail -s $diff < $diff $diff_recipients
|
1996-05-16 00:52:17 +00:00
|
|
|
gzip -9 $diff && mv -f $diff.gz $dir
|
|
|
|
else
|
|
|
|
rm -f $diff
|
|
|
|
fi
|