X-Git-Url: http://git.hcoop.net/bpt/emacs.git/blobdiff_plain/c1473b4cfeb477ced05d457868c5e1eb97a58eb0..3bf234fa520ff90db31fae85f306befdadb24532:/lib-src/rcs2log diff --git a/lib-src/rcs2log b/lib-src/rcs2log index 72818ecb0c..8dd9cdcf2b 100755 --- a/lib-src/rcs2log +++ b/lib-src/rcs2log @@ -2,8 +2,9 @@ # RCS to ChangeLog generator -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 2001, 2002, 2003, -# 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# Copyright (C) 1992-1998, 2001-2014 Free Software Foundation, Inc. + +# Author: Paul Eggert # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -19,7 +20,7 @@ # along with this program. If not, see . -Copyright='Copyright (C) 2008 Free Software Foundation, Inc. +Copyright='Copyright (C) 2014 Free Software Foundation, Inc. This program comes with NO WARRANTY, to the extent permitted by law. You may redistribute copies of this program under the terms of the GNU General Public License. @@ -204,11 +205,19 @@ month_data=' m[9]="Oct"; m[10]="Nov"; m[11]="Dec" ' -logdir=$TMPDIR/rcs2log$$ -llogout=$logdir/l +if type mktemp >/dev/null 2>&1; then + logdir=`mktemp -d` +else + logdir=$TMPDIR/rcs2log$$ + (umask 077 && mkdir "$logdir") +fi || exit +case $logdir in +-*) logdir=./$logdir;; +esac trap exit 1 2 13 15 -trap "rm -fr $logdir 2>/dev/null" 0 -(umask 077 && exec mkdir $logdir) || exit +trap "rm -fr \"$logdir\" 2>/dev/null" 0 + +llogout=$logdir/l # If no rlog-format log file is given, generate one into $rlogfile. case $rlogfile in @@ -416,10 +425,10 @@ case $loginFullnameMailaddrs in ?*) case $loginFullnameMailaddrs in *\"* | *\\*) - sed 's/["\\]/\\&/g' >$llogout <"$llogout" <$llogout || exit +esac >"$llogout" || exit output_authors='/^date: / { - if ($2 ~ /^[0-9]*[-\/][0-9][0-9][-\/][0-9][0-9]$/ && $3 ~ /^[0-9][0-9]:[0-9][0-9]:[0-9][0-9][-+0-9:]*;$/ && $4 == "author:" && $5 ~ /^[^;]*;$/) { - print substr($5, 1, length($5)-1) + cvsformat = $5 == "author:" + if ($2 ~ /^[0-9]*[-\/][0-9][0-9][-\/][0-9][0-9]$/ && (cvsformat ? $3 ~ /^[0-9][0-9]:[0-9][0-9]:[0-9][0-9]/ && $4 ~ /^[-+][0-9:]*;$/ : $3 ~ /^[0-9][0-9]:[0-9][0-9]:[0-9][0-9][-+0-9:]*;$/)) { + author = $(5 + cvsformat) + if ($(4 + cvsformat) == "author:" && author ~ /^[^;]*;$/) { + print substr(author, 1, length(author)-1) + } } }' authors=` - $AWK "$output_authors" <"$rlogfile" | sort -u | comm -23 - $llogout + $AWK "$output_authors" <"$rlogfile" | sort -u | comm -23 - "$llogout" ` case $authors in ?*) - cat >$llogout <"$llogout" <