summaryrefslogtreecommitdiff
path: root/Build/tools
diff options
context:
space:
mode:
Diffstat (limited to 'Build/tools')
-rwxr-xr-xBuild/tools/p4changelog89
-rwxr-xr-xBuild/tools/svnchangelog85
2 files changed, 85 insertions, 89 deletions
diff --git a/Build/tools/p4changelog b/Build/tools/p4changelog
deleted file mode 100755
index 558dc274ec1..00000000000
--- a/Build/tools/p4changelog
+++ /dev/null
@@ -1,89 +0,0 @@
-#!/bin/sh
-# $Id$
-# Public domain. Originally written 2004, Karl Berry.
-# Get change info from p4 describe and p4 changes.
-
-umask 0
-
-debug=${OVERRIDE_DEBUG-false}
-
-mydir=`dirname $0` # Master/Tools
-outdir=`cd $mydir/../../Build/cdbuild/logs && pwd`
-outfile=$outdir/log
-
-line=`grep '^Change' $outfile | head -1`
-lastlogged=`echo "$line" | awk '{print $2}'`
-echo "$lastlogged" | egrep '^[0-9]+$' >/dev/null \
-|| { echo "$0: no change number in Change line of $outfile: $line";
- exit 1; }
-nextneeded=`expr $lastlogged + 1`
-lastchange=`p4 changes -m 1 -s submitted | awk '{print $2}'`
-
-echo "lastlogged=$lastlogged, nextneeded=$nextneeded, lastchange=$lastchange"
-
-# nothing submitted since last change?
-test $lastchange -lt $nextneeded && exit 0
-
-rotate=false
-for c in `seq $lastchange -1 $nextneeded`; do
- echo " getting change $c"
- # rotate if crossed a 500-change mark.
- echo $c | grep '[05]00$' >/dev/null && rotate=true
-
- p4 describe -ds $c 2>&1 \
- | sed -e 's,^\.\.\. //depot/, ,' -e '/^Differences/,$d' \
- | awk '/^Affected files/ { printf "%s", $0; next } {print}' \
- >>$outfile.temp
-done
-
-# we'll update $outfile.
-echo "p4 edit $outfile..."
-$debug || p4 edit $outfile
-
-if $rotate; then
- echo "rotating $lastlogged..."
- mv $outfile $outfile.$lastlogged
- gzip $outfile.$lastlogged
- chmod 444 $outfile.$lastlogged.gz
- ls -l $outfile.$lastlogged.gz
- $debug || p4 add $outfile.$lastlogged.gz
- cp /dev/null $outfile
-fi
-
-# prepend new changes to current log, put into p4.
-cat $outfile.temp $outfile >$outfile.temp2
-
-if $debug; then
- for f in $outfile $outfile.temp $outfile.temp2; do
- echo
- (cd `dirname $f` && ls -l `basename $f`)
- head -1 $f
- grep '^Change' $f | tail -1
- done
-
- exit 0
-fi
-
-mv $outfile.temp2 $outfile
-echo "p4 submit..."
-p4 change -o \
-| sed "s!<enter description here>!regenerated by $0!" \
-| p4 submit -i
-
-cat $outfile.temp # show it to me
-rm -f $outfile.temp
-
-exit 0
-
-# this was how we grabbed all the old entries to get things started.
-for c in `seq 5150 -1 1`; do
- expr $c % 500 >/dev/null \
- || { outfile=$outdir/out.$c; cp /dev/null $outfile; }
-
- # minimal diff, remove even that (hunk counts) with sed,
- # remove newline from "Affected files" line.
- p4 describe -ds $c 2>&1 \
- | sed -e 's,^\.\.\. //depot/, ,' -e '/^Differences/,$d' \
- | awk '/^Affected files/ { printf "%s", $0; next } {print}' \
- >>$outfile
-done
diff --git a/Build/tools/svnchangelog b/Build/tools/svnchangelog
new file mode 100755
index 00000000000..83b9d9e9a92
--- /dev/null
+++ b/Build/tools/svnchangelog
@@ -0,0 +1,85 @@
+#!/bin/sh
+# $Id$
+# Public domain. Originally written 2004, Karl Berry.
+# Get change info from svn log. (see now-deleted p4changelog for the
+# previous code using p4.)
+
+umask 0
+
+debug=true
+chicken=${OVERRIDE_CHICKEN-true}
+
+# to get started, ran svn log and put the first thousand changes in log.
+
+mydir=`dirname $0` # Build/tools
+outdir=`cd $mydir/../cdbuild/logs && pwd`
+outfile=$outdir/svnlog
+
+# get the revision number we last logged
+line=`grep '^r[0-9]' $outfile | head -1 | sed 's/^r//'`
+lastlogged=`echo "$line" | awk '{print $1}'`
+echo "$lastlogged" | egrep '^[0-9]+$' >/dev/null \
+|| { echo "$0: no change number in r line of $outfile: $line";
+ exit 1; }
+
+nextneeded=`expr $lastlogged + 1`
+$debug && echo "lastlogged=$lastlogged, nextneeded=$nextneeded"
+
+# get the log info since then.
+tlroot=`cd ../.. && pwd`
+newlogs=$outdir/newlogdata
+svn log -v -r HEAD:$nextneeded $tlroot >$newlogs
+# with HEAD:next we get the entries newest first, as we want them.
+$debug && ls -l $newlogs
+
+line=`grep '^r[0-9]* |' $newlogs | head -1 | sed 's/^r//'`
+latestchange=`echo "$line" | awk '{print $1}'`
+$debug && echo "latestchange=$latestchange"
+
+# nothing submitted since last change?
+test $latestchange -lt $nextneeded && exit 0
+
+# rotate logs if crossed a 1000-change mark.
+rotate=false
+for c in `seq $latestchange -1 $nextneeded`; do
+ echo $c | grep '001$' >/dev/null && rotate=true
+done
+$debug && echo "rotate=$rotate"
+
+if ! $chicken && $rotate; then
+ mv -v $outfile $outfile.$lastlogged
+ gzip -v $outfile.$lastlogged
+ chmod 444 $outfile.$lastlogged.gz
+ ls -l $outfile.$lastlogged.gz
+ svn add $outfile.$lastlogged.gz
+ cp /dev/null $outfile
+fi
+
+# prepend new changes to current log.
+cat $newlogs $outfile >$outfile.new
+
+if false; then # really debug
+ # show first and last change number in each file.
+ for f in $newlogs $outfile $outfile.new; do
+ echo
+ (cd `dirname $f` && ls -l `basename $f`)
+ grep '^r[0-9]* |' $f | head -1
+ grep '^r[0-9]* |' $f | tail -1
+ done
+fi
+
+
+if ! $chicken; then
+ mv $outfile.new $outfile
+ echo "svn commit..."
+ svn commit -m"regenerated by $0" $outdir
+fi
+
+cat $newlogs # show it to me
+rm -f $newlogs $outfile.new
+
+exit 0
+
+# to get things started:
+svn log -v -r 1000:1 /home/texlive/trunk/ >svnlog
+svn add svnlog