1
0
mirror of https://github.com/anope/anope.git synced 2026-06-28 19:56:39 +02:00
Files
anope/bin/makepatch
T
svn svn@31f1291d-b8d6-0310-a050-a5561fc1590b 55bf4dbcab Initial Anope Import
git-svn-id: svn://svn.anope.org/anope/trunk@1 31f1291d-b8d6-0310-a050-a5561fc1590b


git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@1 5417fbe8-f217-4b02-8779-1006273d7864
2004-03-28 21:59:56 +00:00

84 lines
2.1 KiB
Bash
Executable File

#!/bin/bash
# Daniel Engel (dane@zero.org)
#
# Creates a patch from any version of Anope to another within the
# same CVS module (in this case, anope-rel). Usage:
#
# ./anope-mkpatch 1.5.1 1.5.5
#
# The earliest version you can use is 1.5.1 (the first CVS tag)
#
# Feel free to improve this script at will.
#
CVSROOT=":pserver:pubcvs@zero.org:/home/cvs/anope"
MODULE="anope-dev"
OLD="$1"
NEW="$2"
NAME="$1-$2.diff"
echo "*** Note: This script is able to create patches from one version of 1.5.x"
echo "*** to anoter. The earliest valid version is 1.5.1, and you can only make"
echo "*** a patch between two released versions (i.e. no -rnum versions)"
echo ""
if [[ $OLD == "" ]]; then
echo "*** Usage: $0 [OLD] [NEW]"
exit 0
fi
if [[ $NEW == "" ]]; then
echo "*** Usage: $0 [OLD] [NEW]"
exit 0
fi
OLD="anope-$OLD"
NEW="anope-$NEW"
if [[ -d $OLD ]]; then
echo "*** Directory $OLD already exists... aborting."
exit 0
fi
if [[ -d $NEW ]]; then
echo "*** Directory $OLD already exists... aborting."
exit 0
fi
echo "*** Issuing the CVS login, when prompted for a password, just press RETURN..."
cvs -d $CVSROOT login
if [[ $? -ne 0 ]]; then
echo "*** ERROR: CVS login failed... aborting."
exit 0
fi
TOLD="$(echo $OLD | sed 's/\./_/g')"
TNEW="$(echo $NEW | sed 's/\./_/g')"
echo "*** Cheking out $MODULE ($TOLD)"
cvs -d $CVSROOT checkout -r $TOLD -d $OLD $MODULE > /dev/null 2>&1
if [[ $? -ne 0 ]]; then
echo "*** ERROR: Unable to checkout $MODULE ($TNEW)... aborting."
exit 0
fi
echo "*** Cheking out $MODULE ($TNEW)"
cvs -d $CVSROOT checkout -r $TNEW -d $NEW $MODULE > /dev/null 2>&1
if [[ $? -ne 0 ]]; then
echo "*** ERROR: Unable to checkout $MODULE ($TNEW)... aborting."
exit 0
fi
# I wish i could use cvsrmadm here, but not everybody has it :(
echo "*** Removing CVS control files"
find $OLD -name CVS -exec rm -rf {} \; > /dev/null 2>&1
find $NEW -name CVS -exec rm -rf {} \; > /dev/null 2>&1
echo "*** Creating the patch..."
diff -urN $OLD $NEW > $NAME
echo "*** Done! The patch is $NAME";
echo "*** You might want to clean things up with:"
echo "*** rm -rf $OLD $NEW"