Skip to content

Commit

Permalink
Convert util/mkrel to use git instead of svn
Browse files Browse the repository at this point in the history
(cherry picked from commit 933798d)

Update CHANGES file generation for Git

Use the correct git log invocation for generating the CHANGES file.
(cherry picked from commit 6d204bc)

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 4fc9c72)
  • Loading branch information
greghudson authored and tlyu committed May 16, 2012
1 parent 839395f commit e631461
Showing 1 changed file with 16 additions and 26 deletions.
42 changes: 16 additions & 26 deletions src/util/mkrel
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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"
Expand All @@ -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
Expand All @@ -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

Expand Down Expand Up @@ -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..."
Expand Down

0 comments on commit e631461

Please sign in to comment.