libs-base/make-diff
mccallum 10c0067161 Changed from roland's version to something that makes sense for gstep-base.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1546 72102866-910b-0410-8b05-ffd578937521
1996-05-16 01:49:42 +00:00

63 lines
1.8 KiB
Bash
Executable file

#!/bin/sh
# The directory in which to find the last snapshot
dir=../releases
# The email addresses of people to receive mail about the new diff
diff_recipients=drepper
# The name of this module
module=gstep-base
# A regular expression for the six-digit date string "yymmdd"
yrptn='[0-9][0-9][0-9][0-9][0-9][0-9]'
# The pattern for the file containing the diff
ptn="${module}-${yrptn}"
dptn="${ptn}-${yrptn}.diff"
# Get the current date
date=`date +%y%m%d`
# Find date of the last snapshot
lastsnap=`cd $dir; ls $ptn.tar.gz $dptn $dptn.gz 2>/dev/null |
sed -e "s/^.*\\(${yrptn}\\)[.a-z]*$/\\1/" |
sort -nr | head -1`
# Find the date of the last diff
lastdiff=`cd $dir; ls $dptn $dptn.gz 2>/dev/null |
sed -e "s/^.*\\(${yrptn}\\)[.a-z]*$/\\1/" |
sort -nr | head -1`
# Will we make a CVS tag for this snapshot? An empty value means `tag it'.
# Always disabled for now.
notag=yes
if [ $lastsnap = $date ]; then
if [ $lastdiff = $lastsnap ]; then
echo "$0: Snapshot diff for ${module}-${date} already made, skipping."
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
# The name of the diff file
diff="${module}-${lastdiff}-${date}.diff"
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
if [ -s $diff ]; then
# Mail a message saying the new diff is available. (Commented out for now)
# mail -s $diff < $diff $diff_recipients
gzip -9 $diff && mv -f $diff.gz $dir
else
rm -f $diff
fi