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
  • Loading branch information
greghudson committed May 14, 2012
1 parent cfd3d8d commit 933798d
Showing 1 changed file with 15 additions and 26 deletions.
41 changes: 15 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
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 $repository/$reltag > doc/CHANGES)
fi
else

Expand Down Expand Up @@ -188,9 +177,9 @@ 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 .git \
-o -name \$ac_config_fragdir \) -exec rm -rf {} \; || true

if test $dodoc = t; then
Expand Down

0 comments on commit 933798d

Please sign in to comment.