rc-scripts/trunk/autogen.sh
glen
cvs at pld-linux.org
Sun May 28 21:05:08 CEST 2006
Author: glen
Date: Sun May 28 21:05:06 2006
New Revision: 7454
Modified:
rc-scripts/trunk/autogen.sh
Log:
Always run changelog generation when asked. Obfuscate email addreses here. Use mktemp if available. Allow various locations for CVSROOT/users file.
Modified: rc-scripts/trunk/autogen.sh
==============================================================================
--- rc-scripts/trunk/autogen.sh (original)
+++ rc-scripts/trunk/autogen.sh Sun May 28 21:05:06 2006
@@ -7,12 +7,37 @@
PKG_NAME="PLD Linux Distribution rc-scripts"
-if [ "$1" = "changelog" -a -x ~/bin/svn2log.py ]; then
+if [ "$1" = "changelog" ]; then
+
+ [ -z "$svn2log" -a -x ~/bin/svn2log.py ] && svn2log=~/bin/svn2log.py
+ [ -z "$svn2log" -a -x /usr/bin/svn2log ] && svn2log=/usr/bin/svn2log
+ if [ -z "$svn2log" ]; then
+ echo >&2 'Need svn2log program!'
+ exit 1
+ fi
+
[ -n "$2" ] && dir="$2" || dir="rc-scripts"
- rm -f ${TMPDIR:-/tmp}/svn2log.tmp
- awk -F":" ' { login=$1; if ($3 != "") { name=$3 } else { name=$1 }; email=$2; printf "%s\t%s <%s at pld-linux.org>\n", login, name, login } ' ~/.CVS-PLD/CVSROOT/users > ${TMPDIR:-/tmp}/svn2log.tmp
- svn log -v --xml | ~/bin/svn2log.py --domain "pld-linux.org" -p /${dir}/trunk -u ${TMPDIR:-/tmp}/svn2log.tmp --exclude ChangeLog -o ChangeLog
- rm -f ${TMPDIR:-/tmp}/svn2log.tmp
+ # create users for svn2log format
+ tmp=$(mktemp -q svn2logXXXXXX 2>/dev/null || echo ${TMPDIR:-/tmp}/svn2log.tmp)
+ > $tmp
+
+ [ -z "$users" -a -f ../CVSROOT/users ] && users=../CVSROOT/users
+ [ -z "$users" -a -f ~/.CVS-PLD/CVSROOT/users ] && users=~/.CVS-PLD/CVSROOT/users
+ if [ -z "$users" ]; then
+ echo >&2 "Can't find users file!"
+ echo >&2 'Run in parent dir to fetch one:'
+ echo >&2 '$ cvs -d :pserver:cvs at cvs.pld-linux.org:/cvsroot co CVSROOT/users'
+ exit 1
+ fi
+
+ awk -F":" ' { login=$1; if ($3 != "") { name=$3 } else { name=$1 }; email=$2; printf "%s\t%s <%s at pld-linux.org>\n", login, name, login } ' $users > $tmp
+
+ svn log -v --xml | $svn2log --domain "pld-linux.org" -p /${dir}/trunk -u $tmp --exclude ChangeLog -o ChangeLog
+ rm -f $tmp
+
+ # obfuscate emails <user at domain> and (user at domain)
+ sed -i -e 's,\([<(].*\)@\(.*[)>]\),\1/at/\2,g' ChangeLog
+
exit 0
fi
More information about the pld-cvs-commit
mailing list