krb5 commit [krb5-1.10]: Convert util/mkrel to use git instead of svn

Tom Yu tlyu at MIT.EDU
Tue May 15 22:41:50 EDT 2012


https://github.com/krb5/krb5/commit/a03304db92419f2cd273ed2f070a9ff7eb7d7485
commit a03304db92419f2cd273ed2f070a9ff7eb7d7485
Author: Greg Hudson <ghudson at mit.edu>
Date:   Mon May 14 15:06:51 2012 -0400

    Convert util/mkrel to use git instead of svn
    
    (cherry picked from commit 933798d193ac406b43724f02837e401db09827e3)
    
    Update CHANGES file generation for Git
    
    Use the correct git log invocation for generating the CHANGES file.
    (cherry picked from commit 6d204bc466e2038bacf3e2e3a4b4f5bdc56e6b5e)
    
    Make mkrel work on non-master branches
    
    Appending "--" to the git checkout arguments appears to prevent it
    from automatically creating a local branch from the remote.  Also
    correct the default git URL and clean up a spurious find warning.
    (cherry picked from commit 4fc9c72e5d30c94399baf7069a0d0db25e940a68)

 src/util/mkrel |   42 ++++++++++++++++--------------------------
 1 files changed, 16 insertions(+), 26 deletions(-)

diff --git a/src/util/mkrel b/src/util/mkrel
index 0f07dd3..90c135a 100755
--- a/src/util/mkrel
+++ b/src/util/mkrel
@@ -1,6 +1,6 @@
 #!/bin/sh
 set -e
-repository=svn+ssh://svn.mit.edu/krb5
+repository=git.mit.edu:/git/krb5.git
 dodoc=t
 dosrc=t
 checkout=t
@@ -94,31 +94,25 @@ echo "major=$relmajor minor=$relminor patch=$relpatch"
 # $reltag, $release, $reldate are used for brand.c currently
 # $relmajor, $relminor, $relpatch are used for patchlevel.h currently
 
+if test $checkout = t; then
+	echo "Checking out krb5 with tag $reltag into directory $reldir..."
+	git clone -q -n $repository $reldir
+	(cd $reldir && git checkout -q $reltag)
+fi
+
 #
 # $newstyle = t if patchlevel.h is the master version stamp file.  If
 # so, we don't edit it here.
 #
-if test $checkout = t; then
-	if svn cat $repository/$reltag/src/patchlevel.h | grep KRB5_RELDATE > /dev/null 2>&1; then
-		newstyle=t
-	else
-		newstyle=nil;
-	fi
+if grep KRB5_RELDATE $reldir/src/patchlevel.h > /dev/null 2>&1; then
+	newstyle=t;
 else
-	if grep KRB5_RELDATE $reldir/src/patchlevel.h > /dev/null 2>&1; then
-		newstyle=t;
-	else
-		newstyle=nil;
-	fi
+	newstyle=nil;
 fi
 
 if test $newstyle = t; then
 	echo "parsing new style patchlevel.h..."
-	if test $checkout = t; then
-		eval `svn cat $repository/$reltag/src/patchlevel.h | sed -n 's/#define \([A-Z0-9_]*\)[ \t]*\(.*\)/\1=\2/p'`
-	else
-		eval `sed -n 's/#define \([A-Z0-9_]*\)[ \t]*\(.*\)/\1=\2/p' < $reldir/src/patchlevel.h`
-	fi
+	eval `sed -n 's/#define \([A-Z0-9_]*\)[ \t]*\(.*\)/\1=\2/p' < $reldir/src/patchlevel.h`
 	if test "$KRB5_RELTAG" != $reltag && \
 		test "$KRB5_RELTAG" != `echo $reltag|sed 's%[^/]*/%%'` ; then
 		echo "WARNING: patchlevel.h '$KRB5_RELTAG' != $reltag"
@@ -135,11 +129,6 @@ else
 	echo "old style patchlevel.h"
 fi
 
-if test $checkout = t; then
-	echo "Checking out krb5 with tag $reltag into directory $reldir..."
-	svn export $repository/$reltag $reldir
-fi
-
 echo "Editing release-specific files..."
 
 if test $newstyle = t; then 
@@ -148,7 +137,7 @@ if test $newstyle = t; then
 #define KRB5_RELDATE "'"$reldate"'"' patchlevel.h > patchlevel.h.new && \
 		mv patchlevel.h.new patchlevel.h)
 	if test $checkout = t; then
-		(cd $reldir && svn log -v $repository/$reltag > doc/CHANGES)
+		(cd $reldir && git log --stat $reltag > doc/CHANGES)
 	fi
 else
 
@@ -188,10 +177,11 @@ fi
 
 echo "Nuking unneeded files..."
 find $reldir \( -name TODO -o -name todo -o -name .cvsignore \
-	-o -name BADSYMS -o -name .Sanitize -o -name .rconf \) -print \
-	| xargs rm -f || true
-find $reldir -type d \( -name autom4te.cache -o -name .svn \
+	-o -name .gitignore -o -name BADSYMS -o -name .Sanitize \
+	-o -name .rconf \) -print | xargs rm -f || true
+find $reldir -type d \( -name autom4te.cache \
 	-o -name \$ac_config_fragdir \) -exec rm -rf {} \; || true
+rm -rf $reldir/.git || true
 
 if test $dodoc = t; then
 	echo "Building doc..."


More information about the cvs-krb5 mailing list