libs-base/make-dist-diff

59 lines
1.6 KiB
Text
Raw Normal View History

#!/bin/sh
# The directory in which to find the last snapshot; must be absolute path
dir=/home/mccallum/gnu/releases
# The email addresses of people to receive mail about the new diff
diff_recipients=gnustep-dev@prep.ai.mit.edu
# The name of this module
module=gstep-base
# A regular expression for the version string "x.y.z"
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 version
. Version
# Find date of the last snapshot
lastdist=${VERSION}
# This depends on the user setting this variable from the command line
if [ -z $OLD ]; then
echo You must set the shell variable OLD to the old version number.
exit -1
fi
secondlastdist=${OLD}
echo Making diff between $secondlastdist and $lastdist
# The name of the diff file
diff="${module}-${secondlastdist}-${lastdist}.diff"
if [ -f $dir/$diff ]; then
echo $dir/$diff already exists! Exiting.
exit -1
fi
echo Making $diff
# Untar the old dist
(cd /tmp ; tar -zvxf $dir/${module}-${secondlastdist}.tar.gz)
# Untar the new dist
(cd /tmp ; tar -zvxf $dir/${module}-${lastdist}.tar.gz)
# Make the diff
echo Diffing...
rm -f /tmp/$diff
(cd /tmp; diff -u -r ${module}-${secondlastdist} ${module}-${lastdist} > $diff)
# Remove the dist dirs
rm -rf /tmp/${module}-${secondlastdist} /tmp/${module}-${lastdist}
if [ -s /tmp/$diff ]; then
# Mail a message saying the new diff is available. (Commented out for now)
# mail -s $diff < $diff $diff_recipients
gzip -9 /tmp/$diff && mv -f /tmp/$diff.gz $dir
else
rm -f /tmp/$diff
fi