diff options
Diffstat (limited to 'lib-src')
| -rwxr-xr-x | lib-src/rcs2log | 63 |
1 files changed, 39 insertions, 24 deletions
diff --git a/lib-src/rcs2log b/lib-src/rcs2log index da1efdaa1b6..30af68054f5 100755 --- a/lib-src/rcs2log +++ b/lib-src/rcs2log | |||
| @@ -2,7 +2,7 @@ | |||
| 2 | 2 | ||
| 3 | # RCS to ChangeLog generator | 3 | # RCS to ChangeLog generator |
| 4 | 4 | ||
| 5 | # $Id: rcs2log,v 1.5 1992/04/01 08:57:55 eggert Exp eggert $ | 5 | # $Id: rcs2log,v 1.6 1992/05/08 21:45:00 eggert Exp eggert $ |
| 6 | 6 | ||
| 7 | # Generate a change log prefix from RCS/* and the existing ChangeLog (if any). | 7 | # Generate a change log prefix from RCS/* and the existing ChangeLog (if any). |
| 8 | # Output the new prefix to standard output. | 8 | # Output the new prefix to standard output. |
| @@ -69,34 +69,49 @@ rlog "$datearg" "$@" >$rlogout || exit | |||
| 69 | # Warning: foreign authors (i.e. not known in the passwd file) are mishandled; | 69 | # Warning: foreign authors (i.e. not known in the passwd file) are mishandled; |
| 70 | # you have to fix the resulting output by hand. | 70 | # you have to fix the resulting output by hand. |
| 71 | 71 | ||
| 72 | initialize_fullname= | ||
| 72 | authors=` | 73 | authors=` |
| 73 | sed -n 's|^date: *[0-9]*/[0-9][0-9]/[0-9][0-9] [0-9][0-9]:[0-9][0-9]:[0-9][0-9]; *author: *\([^; ]*\).*|\1|p' <$rlogout | | 74 | sed -n 's|^date: *[0-9]*/[0-9][0-9]/[0-9][0-9] [0-9][0-9]:[0-9][0-9]:[0-9][0-9]; *author: *\([^; ]*\).*|\1|p' <$rlogout | |
| 74 | sort -u | 75 | sort -u |
| 75 | ` | 76 | ` |
| 77 | case $authors in | ||
| 78 | ?*) | ||
| 79 | initialize_author= | ||
| 80 | for author in $authors | ||
| 81 | do | ||
| 82 | initialize_author="$initialize_author | ||
| 83 | author[\"$author\"] = 1 | ||
| 84 | " | ||
| 85 | done | ||
| 86 | |||
| 87 | awkscript=' | ||
| 88 | BEGIN { | ||
| 89 | alphabet = "abcdefghijklmnopqrstuvwxyz" | ||
| 90 | ALPHABET = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" | ||
| 91 | '"$initialize_author"' | ||
| 92 | } | ||
| 93 | { | ||
| 94 | if (author[$1]) { | ||
| 95 | fullname = $5 | ||
| 96 | abbr = index(fullname, "&") | ||
| 97 | if (abbr) { | ||
| 98 | a = substr($1, 1, 1) | ||
| 99 | A = a | ||
| 100 | i = index(alphabet, a) | ||
| 101 | if (i) A = substr(ALPHABET, i, 1) | ||
| 102 | fullname = substr(fullname, 1, abbr-1) A substr($1, 2) substr(fullname, abbr+1) | ||
| 103 | } | ||
| 104 | printf "fullname[\"%s\"] = \"%s\"\n", $1, fullname | ||
| 105 | author[$1] = 0 | ||
| 106 | } | ||
| 107 | } | ||
| 108 | ' | ||
| 76 | 109 | ||
| 77 | initialize_fullname= | 110 | initialize_fullname=` |
| 78 | for author in $authors | 111 | (cat /etc/passwd; ypmatch $authors passwd) 2>/dev/null | |
| 79 | do | 112 | awk -F: "$awkscript" |
| 80 | fullname=` | ||
| 81 | (grep "^$author:" /etc/passwd || ypmatch "$author" passwd) | | ||
| 82 | sed -n 's/^[^:]*:[^:]*:[^:]*:[^:]*:\([^,:]*\).*$/\1/;p;q' | ||
| 83 | ` | 113 | ` |
| 84 | case $fullname in | 114 | esac |
| 85 | *\&*) | ||
| 86 | User=` | ||
| 87 | expr " $author" : ' \(.\)' | | ||
| 88 | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ | ||
| 89 | `` | ||
| 90 | expr " $author" : ' .\(.*\)' | ||
| 91 | ` | ||
| 92 | fullname=`echo "$fullname" | sed "s:&:$User:"` | ||
| 93 | esac | ||
| 94 | case $fullname in | ||
| 95 | ?*) | ||
| 96 | initialize_fullname="$initialize_fullname | ||
| 97 | fullname[\"$author\"] = \"$fullname\"" | ||
| 98 | esac | ||
| 99 | done | ||
| 100 | 115 | ||
| 101 | 116 | ||
| 102 | # Function to print a single log line. | 117 | # Function to print a single log line. |
| @@ -162,7 +177,7 @@ awk <$rlogout ' | |||
| 162 | # FILENAME YYYY/MM/DD HH:MM:SS AUTHOR \rLOG | 177 | # FILENAME YYYY/MM/DD HH:MM:SS AUTHOR \rLOG |
| 163 | # where \r stands for a carriage return, | 178 | # where \r stands for a carriage return, |
| 164 | # and each line of the log is terminated by \r instead of \n. | 179 | # and each line of the log is terminated by \r instead of \n. |
| 165 | # Sort the log entries, first by date (in reverse order), | 180 | # Sort the log entries, first by date+time (in reverse order), |
| 166 | # then by author, then by log entry, and finally by file name (just in case). | 181 | # then by author, then by log entry, and finally by file name (just in case). |
| 167 | sort +1 -3r +3 +0 | | 182 | sort +1 -3r +3 +0 | |
| 168 | 183 | ||