annotate lib-src/rcs2log @ 1800:05cb79ebdb23

Add copyright and authorship notices.
author Paul Eggert <eggert@twinsun.com>
date Fri, 15 Jan 1993 05:33:29 +0000
parents 8abf83cc14b1
children 66371f0b8aff
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
527
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
1 #!/bin/sh
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
2
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
3 # RCS to ChangeLog generator
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
4
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
5 # Generate a change log prefix from RCS/* and the existing ChangeLog (if any).
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
6 # Output the new prefix to standard output.
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
7 # You can edit this prefix by hand, and then prepend it to ChangeLog.
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
8
636
dce8cdbac0ea Ignore log messages that start with `#'.
Paul Eggert <eggert@twinsun.com>
parents: 602
diff changeset
9 # Ignore log entries that start with `#'.
dce8cdbac0ea Ignore log messages that start with `#'.
Paul Eggert <eggert@twinsun.com>
parents: 602
diff changeset
10 # Clump together log entries that start with `{topic} ',
dce8cdbac0ea Ignore log messages that start with `#'.
Paul Eggert <eggert@twinsun.com>
parents: 602
diff changeset
11 # where `topic' contains neither white space nor `}'.
527
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
12
1800
05cb79ebdb23 Add copyright and authorship notices.
Paul Eggert <eggert@twinsun.com>
parents: 1228
diff changeset
13 # Author: Paul Eggert <eggert@twinsun.com>
05cb79ebdb23 Add copyright and authorship notices.
Paul Eggert <eggert@twinsun.com>
parents: 1228
diff changeset
14
05cb79ebdb23 Add copyright and authorship notices.
Paul Eggert <eggert@twinsun.com>
parents: 1228
diff changeset
15 # $Id: rcs2log,v 1.8 1992/09/27 01:55:21 roland Exp eggert $
05cb79ebdb23 Add copyright and authorship notices.
Paul Eggert <eggert@twinsun.com>
parents: 1228
diff changeset
16
05cb79ebdb23 Add copyright and authorship notices.
Paul Eggert <eggert@twinsun.com>
parents: 1228
diff changeset
17 # Copyright 1992, 1993 Free Software Foundation, Inc.
05cb79ebdb23 Add copyright and authorship notices.
Paul Eggert <eggert@twinsun.com>
parents: 1228
diff changeset
18
05cb79ebdb23 Add copyright and authorship notices.
Paul Eggert <eggert@twinsun.com>
parents: 1228
diff changeset
19 # This program is free software; you can redistribute it and/or modify
05cb79ebdb23 Add copyright and authorship notices.
Paul Eggert <eggert@twinsun.com>
parents: 1228
diff changeset
20 # it under the terms of the GNU General Public License as published by
05cb79ebdb23 Add copyright and authorship notices.
Paul Eggert <eggert@twinsun.com>
parents: 1228
diff changeset
21 # the Free Software Foundation; either version 2, or (at your option)
05cb79ebdb23 Add copyright and authorship notices.
Paul Eggert <eggert@twinsun.com>
parents: 1228
diff changeset
22 # any later version.
05cb79ebdb23 Add copyright and authorship notices.
Paul Eggert <eggert@twinsun.com>
parents: 1228
diff changeset
23 #
05cb79ebdb23 Add copyright and authorship notices.
Paul Eggert <eggert@twinsun.com>
parents: 1228
diff changeset
24 # This program is distributed in the hope that it will be useful,
05cb79ebdb23 Add copyright and authorship notices.
Paul Eggert <eggert@twinsun.com>
parents: 1228
diff changeset
25 # but WITHOUT ANY WARRANTY; without even the implied warranty of
05cb79ebdb23 Add copyright and authorship notices.
Paul Eggert <eggert@twinsun.com>
parents: 1228
diff changeset
26 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
05cb79ebdb23 Add copyright and authorship notices.
Paul Eggert <eggert@twinsun.com>
parents: 1228
diff changeset
27 # GNU General Public License for more details.
05cb79ebdb23 Add copyright and authorship notices.
Paul Eggert <eggert@twinsun.com>
parents: 1228
diff changeset
28 #
05cb79ebdb23 Add copyright and authorship notices.
Paul Eggert <eggert@twinsun.com>
parents: 1228
diff changeset
29 # You should have received a copy of the GNU General Public License
05cb79ebdb23 Add copyright and authorship notices.
Paul Eggert <eggert@twinsun.com>
parents: 1228
diff changeset
30 # along with this program; see the file COPYING. If not, write to
05cb79ebdb23 Add copyright and authorship notices.
Paul Eggert <eggert@twinsun.com>
parents: 1228
diff changeset
31 # the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
05cb79ebdb23 Add copyright and authorship notices.
Paul Eggert <eggert@twinsun.com>
parents: 1228
diff changeset
32
05cb79ebdb23 Add copyright and authorship notices.
Paul Eggert <eggert@twinsun.com>
parents: 1228
diff changeset
33
534
6f7abc0e1f10 Add -i, -l, -t.
Paul Eggert <eggert@twinsun.com>
parents: 527
diff changeset
34 # Parse options.
6f7abc0e1f10 Add -i, -l, -t.
Paul Eggert <eggert@twinsun.com>
parents: 527
diff changeset
35
6f7abc0e1f10 Add -i, -l, -t.
Paul Eggert <eggert@twinsun.com>
parents: 527
diff changeset
36 # defaults
6f7abc0e1f10 Add -i, -l, -t.
Paul Eggert <eggert@twinsun.com>
parents: 527
diff changeset
37 indent=8 # indent of log line
6f7abc0e1f10 Add -i, -l, -t.
Paul Eggert <eggert@twinsun.com>
parents: 527
diff changeset
38 length=79 # suggested max width of log line
6f7abc0e1f10 Add -i, -l, -t.
Paul Eggert <eggert@twinsun.com>
parents: 527
diff changeset
39 tabwidth=8 # width of horizontal tab
6f7abc0e1f10 Add -i, -l, -t.
Paul Eggert <eggert@twinsun.com>
parents: 527
diff changeset
40
6f7abc0e1f10 Add -i, -l, -t.
Paul Eggert <eggert@twinsun.com>
parents: 527
diff changeset
41 while :
6f7abc0e1f10 Add -i, -l, -t.
Paul Eggert <eggert@twinsun.com>
parents: 527
diff changeset
42 do
6f7abc0e1f10 Add -i, -l, -t.
Paul Eggert <eggert@twinsun.com>
parents: 527
diff changeset
43 case $1 in
6f7abc0e1f10 Add -i, -l, -t.
Paul Eggert <eggert@twinsun.com>
parents: 527
diff changeset
44 -i) indent=${2?};;
6f7abc0e1f10 Add -i, -l, -t.
Paul Eggert <eggert@twinsun.com>
parents: 527
diff changeset
45 -l) length=${2?};;
6f7abc0e1f10 Add -i, -l, -t.
Paul Eggert <eggert@twinsun.com>
parents: 527
diff changeset
46 -t) tabwidth=${2?};;
6f7abc0e1f10 Add -i, -l, -t.
Paul Eggert <eggert@twinsun.com>
parents: 527
diff changeset
47 -*) echo >&2 "$0: usage: $0 [-i indent] [-l length] [-t tabwidth] [file ...]"
6f7abc0e1f10 Add -i, -l, -t.
Paul Eggert <eggert@twinsun.com>
parents: 527
diff changeset
48 exit 1;;
6f7abc0e1f10 Add -i, -l, -t.
Paul Eggert <eggert@twinsun.com>
parents: 527
diff changeset
49 *) break
6f7abc0e1f10 Add -i, -l, -t.
Paul Eggert <eggert@twinsun.com>
parents: 527
diff changeset
50 esac
6f7abc0e1f10 Add -i, -l, -t.
Paul Eggert <eggert@twinsun.com>
parents: 527
diff changeset
51 shift; shift
6f7abc0e1f10 Add -i, -l, -t.
Paul Eggert <eggert@twinsun.com>
parents: 527
diff changeset
52 done
6f7abc0e1f10 Add -i, -l, -t.
Paul Eggert <eggert@twinsun.com>
parents: 527
diff changeset
53
6f7abc0e1f10 Add -i, -l, -t.
Paul Eggert <eggert@twinsun.com>
parents: 527
diff changeset
54
527
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
55 # Log into $rlogout the revisions checked in since the first ChangeLog entry.
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
56
602
d2de231ee7f5 Don't duplicate most recent logs. Fix bug in dates after Feb 29 in leap year.
Paul Eggert <eggert@twinsun.com>
parents: 594
diff changeset
57 date=1970
527
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
58 if test -s ChangeLog
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
59 then
602
d2de231ee7f5 Don't duplicate most recent logs. Fix bug in dates after Feb 29 in leap year.
Paul Eggert <eggert@twinsun.com>
parents: 594
diff changeset
60 # Add 1 to seconds to avoid duplicating most recent log.
d2de231ee7f5 Don't duplicate most recent logs. Fix bug in dates after Feb 29 in leap year.
Paul Eggert <eggert@twinsun.com>
parents: 594
diff changeset
61 # It's a good thing `rlog' doesn't mind a time ending in `:60'.
d2de231ee7f5 Don't duplicate most recent logs. Fix bug in dates after Feb 29 in leap year.
Paul Eggert <eggert@twinsun.com>
parents: 594
diff changeset
62 e='
d2de231ee7f5 Don't duplicate most recent logs. Fix bug in dates after Feb 29 in leap year.
Paul Eggert <eggert@twinsun.com>
parents: 594
diff changeset
63 /^... ... [ 0-9][0-9] [ 0-9][0-9]:[0-9][0-9]:[0-9][0-9] [0-9]+ /{
1228
8abf83cc14b1 %.2d -> %02d
Roland McGrath <roland@gnu.org>
parents: 640
diff changeset
64 printf "%s%02d %s\n", substr($0,1,17), substr($0,18,2)+1, $5
602
d2de231ee7f5 Don't duplicate most recent logs. Fix bug in dates after Feb 29 in leap year.
Paul Eggert <eggert@twinsun.com>
parents: 594
diff changeset
65 exit
d2de231ee7f5 Don't duplicate most recent logs. Fix bug in dates after Feb 29 in leap year.
Paul Eggert <eggert@twinsun.com>
parents: 594
diff changeset
66 }
d2de231ee7f5 Don't duplicate most recent logs. Fix bug in dates after Feb 29 in leap year.
Paul Eggert <eggert@twinsun.com>
parents: 594
diff changeset
67 '
d2de231ee7f5 Don't duplicate most recent logs. Fix bug in dates after Feb 29 in leap year.
Paul Eggert <eggert@twinsun.com>
parents: 594
diff changeset
68 d=`awk "$e" <ChangeLog` || exit
d2de231ee7f5 Don't duplicate most recent logs. Fix bug in dates after Feb 29 in leap year.
Paul Eggert <eggert@twinsun.com>
parents: 594
diff changeset
69 case $d in
d2de231ee7f5 Don't duplicate most recent logs. Fix bug in dates after Feb 29 in leap year.
Paul Eggert <eggert@twinsun.com>
parents: 594
diff changeset
70 ?*) date=$d
535
4b75abb93479 Don't munge $* when getting date from ChangeLog.
Paul Eggert <eggert@twinsun.com>
parents: 534
diff changeset
71 esac
527
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
72 fi
602
d2de231ee7f5 Don't duplicate most recent logs. Fix bug in dates after Feb 29 in leap year.
Paul Eggert <eggert@twinsun.com>
parents: 594
diff changeset
73 datearg="-d>$date"
527
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
74
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
75 rlogout=/tmp/chg$$
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
76 trap exit 1 2 13 15
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
77 trap 'rm -f $rlogout; exit 1' 0
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
78
534
6f7abc0e1f10 Add -i, -l, -t.
Paul Eggert <eggert@twinsun.com>
parents: 527
diff changeset
79 case $# in
6f7abc0e1f10 Add -i, -l, -t.
Paul Eggert <eggert@twinsun.com>
parents: 527
diff changeset
80 0) set RCS/*
6f7abc0e1f10 Add -i, -l, -t.
Paul Eggert <eggert@twinsun.com>
parents: 527
diff changeset
81 esac
6f7abc0e1f10 Add -i, -l, -t.
Paul Eggert <eggert@twinsun.com>
parents: 527
diff changeset
82
6f7abc0e1f10 Add -i, -l, -t.
Paul Eggert <eggert@twinsun.com>
parents: 527
diff changeset
83 rlog "$datearg" "$@" >$rlogout || exit
527
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
84
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
85
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
86 # Get the full name of each author the logs mention, and set initialize_fullname
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
87 # to awk code that initializes the `fullname' awk associative array.
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
88 # Warning: foreign authors (i.e. not known in the passwd file) are mishandled;
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
89 # you have to fix the resulting output by hand.
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
90
640
36e7f4e402bd Call ypmatch at most once.
Paul Eggert <eggert@twinsun.com>
parents: 636
diff changeset
91 initialize_fullname=
527
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
92 authors=`
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
93 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 |
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
94 sort -u
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
95 `
640
36e7f4e402bd Call ypmatch at most once.
Paul Eggert <eggert@twinsun.com>
parents: 636
diff changeset
96 case $authors in
36e7f4e402bd Call ypmatch at most once.
Paul Eggert <eggert@twinsun.com>
parents: 636
diff changeset
97 ?*)
36e7f4e402bd Call ypmatch at most once.
Paul Eggert <eggert@twinsun.com>
parents: 636
diff changeset
98 initialize_author=
36e7f4e402bd Call ypmatch at most once.
Paul Eggert <eggert@twinsun.com>
parents: 636
diff changeset
99 for author in $authors
36e7f4e402bd Call ypmatch at most once.
Paul Eggert <eggert@twinsun.com>
parents: 636
diff changeset
100 do
36e7f4e402bd Call ypmatch at most once.
Paul Eggert <eggert@twinsun.com>
parents: 636
diff changeset
101 initialize_author="$initialize_author
36e7f4e402bd Call ypmatch at most once.
Paul Eggert <eggert@twinsun.com>
parents: 636
diff changeset
102 author[\"$author\"] = 1
36e7f4e402bd Call ypmatch at most once.
Paul Eggert <eggert@twinsun.com>
parents: 636
diff changeset
103 "
36e7f4e402bd Call ypmatch at most once.
Paul Eggert <eggert@twinsun.com>
parents: 636
diff changeset
104 done
527
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
105
640
36e7f4e402bd Call ypmatch at most once.
Paul Eggert <eggert@twinsun.com>
parents: 636
diff changeset
106 awkscript='
36e7f4e402bd Call ypmatch at most once.
Paul Eggert <eggert@twinsun.com>
parents: 636
diff changeset
107 BEGIN {
36e7f4e402bd Call ypmatch at most once.
Paul Eggert <eggert@twinsun.com>
parents: 636
diff changeset
108 alphabet = "abcdefghijklmnopqrstuvwxyz"
36e7f4e402bd Call ypmatch at most once.
Paul Eggert <eggert@twinsun.com>
parents: 636
diff changeset
109 ALPHABET = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
36e7f4e402bd Call ypmatch at most once.
Paul Eggert <eggert@twinsun.com>
parents: 636
diff changeset
110 '"$initialize_author"'
36e7f4e402bd Call ypmatch at most once.
Paul Eggert <eggert@twinsun.com>
parents: 636
diff changeset
111 }
36e7f4e402bd Call ypmatch at most once.
Paul Eggert <eggert@twinsun.com>
parents: 636
diff changeset
112 {
36e7f4e402bd Call ypmatch at most once.
Paul Eggert <eggert@twinsun.com>
parents: 636
diff changeset
113 if (author[$1]) {
36e7f4e402bd Call ypmatch at most once.
Paul Eggert <eggert@twinsun.com>
parents: 636
diff changeset
114 fullname = $5
36e7f4e402bd Call ypmatch at most once.
Paul Eggert <eggert@twinsun.com>
parents: 636
diff changeset
115 abbr = index(fullname, "&")
36e7f4e402bd Call ypmatch at most once.
Paul Eggert <eggert@twinsun.com>
parents: 636
diff changeset
116 if (abbr) {
36e7f4e402bd Call ypmatch at most once.
Paul Eggert <eggert@twinsun.com>
parents: 636
diff changeset
117 a = substr($1, 1, 1)
36e7f4e402bd Call ypmatch at most once.
Paul Eggert <eggert@twinsun.com>
parents: 636
diff changeset
118 A = a
36e7f4e402bd Call ypmatch at most once.
Paul Eggert <eggert@twinsun.com>
parents: 636
diff changeset
119 i = index(alphabet, a)
36e7f4e402bd Call ypmatch at most once.
Paul Eggert <eggert@twinsun.com>
parents: 636
diff changeset
120 if (i) A = substr(ALPHABET, i, 1)
36e7f4e402bd Call ypmatch at most once.
Paul Eggert <eggert@twinsun.com>
parents: 636
diff changeset
121 fullname = substr(fullname, 1, abbr-1) A substr($1, 2) substr(fullname, abbr+1)
36e7f4e402bd Call ypmatch at most once.
Paul Eggert <eggert@twinsun.com>
parents: 636
diff changeset
122 }
36e7f4e402bd Call ypmatch at most once.
Paul Eggert <eggert@twinsun.com>
parents: 636
diff changeset
123 printf "fullname[\"%s\"] = \"%s\"\n", $1, fullname
36e7f4e402bd Call ypmatch at most once.
Paul Eggert <eggert@twinsun.com>
parents: 636
diff changeset
124 author[$1] = 0
36e7f4e402bd Call ypmatch at most once.
Paul Eggert <eggert@twinsun.com>
parents: 636
diff changeset
125 }
36e7f4e402bd Call ypmatch at most once.
Paul Eggert <eggert@twinsun.com>
parents: 636
diff changeset
126 }
36e7f4e402bd Call ypmatch at most once.
Paul Eggert <eggert@twinsun.com>
parents: 636
diff changeset
127 '
36e7f4e402bd Call ypmatch at most once.
Paul Eggert <eggert@twinsun.com>
parents: 636
diff changeset
128
36e7f4e402bd Call ypmatch at most once.
Paul Eggert <eggert@twinsun.com>
parents: 636
diff changeset
129 initialize_fullname=`
36e7f4e402bd Call ypmatch at most once.
Paul Eggert <eggert@twinsun.com>
parents: 636
diff changeset
130 (cat /etc/passwd; ypmatch $authors passwd) 2>/dev/null |
36e7f4e402bd Call ypmatch at most once.
Paul Eggert <eggert@twinsun.com>
parents: 636
diff changeset
131 awk -F: "$awkscript"
527
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
132 `
640
36e7f4e402bd Call ypmatch at most once.
Paul Eggert <eggert@twinsun.com>
parents: 636
diff changeset
133 esac
527
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
134
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
135
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
136 # Function to print a single log line.
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
137 # We don't use awk functions, to stay compatible with old awk versions.
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
138 # `Log' is the log message (with \n replaced by \r).
594
efa0c124c178 Add clumpname support.
Paul Eggert <eggert@twinsun.com>
parents: 535
diff changeset
139 # `files' contains the affected files.
527
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
140 printlogline='{
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
141
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
142 # Following the GNU coding standards, rewrite
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
143 # * file: (function): comment
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
144 # to
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
145 # * file (function): comment
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
146 if (Log ~ /^\([^)]*\): /) {
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
147 i = index(Log, ")")
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
148 files = files " " substr(Log, 1, i)
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
149 Log = substr(Log, i+3)
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
150 }
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
151
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
152 # If "label: comment" is too long, break the line after the ":".
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
153 sep = " "
534
6f7abc0e1f10 Add -i, -l, -t.
Paul Eggert <eggert@twinsun.com>
parents: 527
diff changeset
154 if ('"$length"' <= '"$indent"' + 1 + length(files) + index(Log, "\r")) sep = "\n" indent_string
527
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
155
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
156 # Print the label.
534
6f7abc0e1f10 Add -i, -l, -t.
Paul Eggert <eggert@twinsun.com>
parents: 527
diff changeset
157 printf "%s*%s:", indent_string, files
527
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
158
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
159 # Print each line of the log, transliterating \r to \n.
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
160 while ((i = index(Log, "\r")) != 0) {
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
161 printf "%s%s\n", sep, substr(Log, 1, i-1)
534
6f7abc0e1f10 Add -i, -l, -t.
Paul Eggert <eggert@twinsun.com>
parents: 527
diff changeset
162 sep = indent_string
527
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
163 Log = substr(Log, i+1)
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
164 }
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
165 }'
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
166
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
167 hostname=`(
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
168 hostname || cat /etc/whoami || uuname -l || uname -n
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
169 ) 2>/dev/null` || {
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
170 echo >&2 "$0: cannot deduce hostname"
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
171 exit 1
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
172 }
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
173
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
174
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
175 # Process the rlog output, generating ChangeLog style entries.
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
176
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
177 # First, reformat the rlog output so that each line contains one log entry.
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
178 # Transliterate \n to \r so that multiline entries fit on a single line.
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
179 # Discard irrelevant rlog output.
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
180 awk <$rlogout '
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
181 /^Working file:/ { filename = $3 }
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
182 /^date: /, /^(-----------*|===========*)$/ {
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
183 if ($0 ~ /^branches: /) { next }
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
184 if ($0 ~ /^date: [0-9][ /0-9:]*;/) {
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
185 time = substr($3, 1, length($3)-1)
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
186 author = substr($5, 1, length($5)-1)
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
187 printf "%s %s %s %s \r", filename, $2, time, author
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
188 next
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
189 }
636
dce8cdbac0ea Ignore log messages that start with `#'.
Paul Eggert <eggert@twinsun.com>
parents: 602
diff changeset
190 if ($0 ~ /^(-----------*|===========*)$/) { print ""; next }
dce8cdbac0ea Ignore log messages that start with `#'.
Paul Eggert <eggert@twinsun.com>
parents: 602
diff changeset
191 printf "%s\r", $0
527
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
192 }
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
193 ' |
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
194
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
195 # Now each line is of the form
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
196 # FILENAME YYYY/MM/DD HH:MM:SS AUTHOR \rLOG
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
197 # where \r stands for a carriage return,
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
198 # and each line of the log is terminated by \r instead of \n.
640
36e7f4e402bd Call ypmatch at most once.
Paul Eggert <eggert@twinsun.com>
parents: 636
diff changeset
199 # Sort the log entries, first by date+time (in reverse order),
527
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
200 # then by author, then by log entry, and finally by file name (just in case).
602
d2de231ee7f5 Don't duplicate most recent logs. Fix bug in dates after Feb 29 in leap year.
Paul Eggert <eggert@twinsun.com>
parents: 594
diff changeset
201 sort +1 -3r +3 +0 |
527
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
202
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
203 # Finally, reformat the sorted log entries.
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
204 awk '
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
205 BEGIN {
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
206
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
207 # Initialize the fullname associative array.
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
208 '"$initialize_fullname"'
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
209
534
6f7abc0e1f10 Add -i, -l, -t.
Paul Eggert <eggert@twinsun.com>
parents: 527
diff changeset
210 # Initialize indent string.
6f7abc0e1f10 Add -i, -l, -t.
Paul Eggert <eggert@twinsun.com>
parents: 527
diff changeset
211 indent_string = ""
6f7abc0e1f10 Add -i, -l, -t.
Paul Eggert <eggert@twinsun.com>
parents: 527
diff changeset
212 i = '"$indent"'
6f7abc0e1f10 Add -i, -l, -t.
Paul Eggert <eggert@twinsun.com>
parents: 527
diff changeset
213 if (0 < '"$tabwidth"')
6f7abc0e1f10 Add -i, -l, -t.
Paul Eggert <eggert@twinsun.com>
parents: 527
diff changeset
214 for (; '"$tabwidth"' <= i; i -= '"$tabwidth"')
6f7abc0e1f10 Add -i, -l, -t.
Paul Eggert <eggert@twinsun.com>
parents: 527
diff changeset
215 indent_string = indent_string "\t"
6f7abc0e1f10 Add -i, -l, -t.
Paul Eggert <eggert@twinsun.com>
parents: 527
diff changeset
216 while (1 <= i--)
6f7abc0e1f10 Add -i, -l, -t.
Paul Eggert <eggert@twinsun.com>
parents: 527
diff changeset
217 indent_string = indent_string " "
6f7abc0e1f10 Add -i, -l, -t.
Paul Eggert <eggert@twinsun.com>
parents: 527
diff changeset
218
527
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
219 # Set up date conversion tables.
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
220 # RCS uses a nice, clean, sortable format,
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
221 # but ChangeLog wants the traditional, ugly ctime format.
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
222
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
223 # January 1, 0 AD (Gregorian) was Saturday = 6
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
224 EPOCH_WEEKDAY = 6
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
225 # Of course, there was no 0 AD, but the algorithm works anyway.
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
226
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
227 w[0]="Sun"; w[1]="Mon"; w[2]="Tue"; w[3]="Wed"
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
228 w[4]="Thu"; w[5]="Fri"; w[6]="Sat"
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
229
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
230 m[0]="Jan"; m[1]="Feb"; m[2]="Mar"
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
231 m[3]="Apr"; m[4]="May"; m[5]="Jun"
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
232 m[6]="Jul"; m[7]="Aug"; m[8]="Sep"
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
233 m[9]="Oct"; m[10]="Nov"; m[11]="Dec"
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
234
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
235 # days in non-leap year thus far, indexed by month (0-12)
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
236 mo[0]=0; mo[1]=31; mo[2]=59; mo[3]=90
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
237 mo[4]=120; mo[5]=151; mo[6]=181; mo[7]=212
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
238 mo[8]=243; mo[9]=273; mo[10]=304; mo[11]=334
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
239 mo[12]=365
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
240 }
636
dce8cdbac0ea Ignore log messages that start with `#'.
Paul Eggert <eggert@twinsun.com>
parents: 602
diff changeset
241
527
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
242 {
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
243 newlog = substr($0, 1 + index($0, "\r"))
636
dce8cdbac0ea Ignore log messages that start with `#'.
Paul Eggert <eggert@twinsun.com>
parents: 602
diff changeset
244
dce8cdbac0ea Ignore log messages that start with `#'.
Paul Eggert <eggert@twinsun.com>
parents: 602
diff changeset
245 # Ignore log entries prefixed by "#".
dce8cdbac0ea Ignore log messages that start with `#'.
Paul Eggert <eggert@twinsun.com>
parents: 602
diff changeset
246 if (newlog ~ /^#/) { next }
dce8cdbac0ea Ignore log messages that start with `#'.
Paul Eggert <eggert@twinsun.com>
parents: 602
diff changeset
247
527
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
248 if (Log != newlog || date != $2 || author != $4) {
594
efa0c124c178 Add clumpname support.
Paul Eggert <eggert@twinsun.com>
parents: 535
diff changeset
249
527
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
250 # The previous log and this log differ.
594
efa0c124c178 Add clumpname support.
Paul Eggert <eggert@twinsun.com>
parents: 535
diff changeset
251
efa0c124c178 Add clumpname support.
Paul Eggert <eggert@twinsun.com>
parents: 535
diff changeset
252 # Print the old log.
527
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
253 if (date != "") '"$printlogline"'
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
254
594
efa0c124c178 Add clumpname support.
Paul Eggert <eggert@twinsun.com>
parents: 535
diff changeset
255 # Logs that begin with "{clumpname} " should be grouped together,
efa0c124c178 Add clumpname support.
Paul Eggert <eggert@twinsun.com>
parents: 535
diff changeset
256 # and the clumpname should be removed.
efa0c124c178 Add clumpname support.
Paul Eggert <eggert@twinsun.com>
parents: 535
diff changeset
257 # Extract the new clumpname from the log header,
efa0c124c178 Add clumpname support.
Paul Eggert <eggert@twinsun.com>
parents: 535
diff changeset
258 # and use it to decide whether to output a blank line.
efa0c124c178 Add clumpname support.
Paul Eggert <eggert@twinsun.com>
parents: 535
diff changeset
259 newclumpname = ""
efa0c124c178 Add clumpname support.
Paul Eggert <eggert@twinsun.com>
parents: 535
diff changeset
260 sep = "\n"
602
d2de231ee7f5 Don't duplicate most recent logs. Fix bug in dates after Feb 29 in leap year.
Paul Eggert <eggert@twinsun.com>
parents: 594
diff changeset
261 if (date == "") sep = ""
636
dce8cdbac0ea Ignore log messages that start with `#'.
Paul Eggert <eggert@twinsun.com>
parents: 602
diff changeset
262 if (newlog ~ /^{[^ }]*}[ ]/) {
594
efa0c124c178 Add clumpname support.
Paul Eggert <eggert@twinsun.com>
parents: 535
diff changeset
263 i = index(newlog, "}")
efa0c124c178 Add clumpname support.
Paul Eggert <eggert@twinsun.com>
parents: 535
diff changeset
264 newclumpname = substr(newlog, 1, i)
efa0c124c178 Add clumpname support.
Paul Eggert <eggert@twinsun.com>
parents: 535
diff changeset
265 while (substr(newlog, i+1) ~ /^[ ]/) i++
efa0c124c178 Add clumpname support.
Paul Eggert <eggert@twinsun.com>
parents: 535
diff changeset
266 newlog = substr(newlog, i+1)
efa0c124c178 Add clumpname support.
Paul Eggert <eggert@twinsun.com>
parents: 535
diff changeset
267 if (clumpname == newclumpname) sep = ""
efa0c124c178 Add clumpname support.
Paul Eggert <eggert@twinsun.com>
parents: 535
diff changeset
268 }
efa0c124c178 Add clumpname support.
Paul Eggert <eggert@twinsun.com>
parents: 535
diff changeset
269 printf sep
efa0c124c178 Add clumpname support.
Paul Eggert <eggert@twinsun.com>
parents: 535
diff changeset
270 clumpname = newclumpname
efa0c124c178 Add clumpname support.
Paul Eggert <eggert@twinsun.com>
parents: 535
diff changeset
271
527
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
272 # Get ready for the next log.
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
273 Log = newlog
534
6f7abc0e1f10 Add -i, -l, -t.
Paul Eggert <eggert@twinsun.com>
parents: 527
diff changeset
274 if (files != "")
6f7abc0e1f10 Add -i, -l, -t.
Paul Eggert <eggert@twinsun.com>
parents: 527
diff changeset
275 for (i in filesknown)
6f7abc0e1f10 Add -i, -l, -t.
Paul Eggert <eggert@twinsun.com>
parents: 527
diff changeset
276 filesknown[i] = 0
527
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
277 files = ""
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
278 }
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
279 if (date != $2 || author != $4) {
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
280 # The previous date+author and this date+author differ.
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
281 # Print the new one.
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
282 date = $2
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
283 author = $4
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
284
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
285 # Convert nice RCS date like "1992/01/03 00:03:44"
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
286 # into ugly ctime date like "Fri Jan 3 00:03:44 1992".
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
287 # Calculate day of week from Gregorian calendar.
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
288 i = index($2, "/")
602
d2de231ee7f5 Don't duplicate most recent logs. Fix bug in dates after Feb 29 in leap year.
Paul Eggert <eggert@twinsun.com>
parents: 594
diff changeset
289 year = substr($2, 1, i-1) + 0
527
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
290 monthday = substr($2, i+1)
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
291 i = index(monthday, "/")
602
d2de231ee7f5 Don't duplicate most recent logs. Fix bug in dates after Feb 29 in leap year.
Paul Eggert <eggert@twinsun.com>
parents: 594
diff changeset
292 month = substr(monthday, 1, i-1) + 0
d2de231ee7f5 Don't duplicate most recent logs. Fix bug in dates after Feb 29 in leap year.
Paul Eggert <eggert@twinsun.com>
parents: 594
diff changeset
293 day = substr(monthday, i+1) + 0
527
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
294 leap = 0
602
d2de231ee7f5 Don't duplicate most recent logs. Fix bug in dates after Feb 29 in leap year.
Paul Eggert <eggert@twinsun.com>
parents: 594
diff changeset
295 if (2 < month && year%4 == 0 && (year%100 != 0 || year%400 == 0)) leap = 1
527
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
296 days_since_Sunday_before_epoch = EPOCH_WEEKDAY + year * 365 + int((year + 3) / 4) - int((year + 99) / 100) + int((year + 399) / 400) + mo[month-1] + leap + day - 1
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
297
534
6f7abc0e1f10 Add -i, -l, -t.
Paul Eggert <eggert@twinsun.com>
parents: 527
diff changeset
298 # Print "date fullname (email address)" if the fullname is known;
6f7abc0e1f10 Add -i, -l, -t.
Paul Eggert <eggert@twinsun.com>
parents: 527
diff changeset
299 # print "date author" otherwise.
527
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
300 # Get the fullname from the associative array.
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
301 # The email address is just author@thishostname.
534
6f7abc0e1f10 Add -i, -l, -t.
Paul Eggert <eggert@twinsun.com>
parents: 527
diff changeset
302 printf "%s %s %2d %s %d ", w[days_since_Sunday_before_epoch%7], m[month-1], day, $3, year
6f7abc0e1f10 Add -i, -l, -t.
Paul Eggert <eggert@twinsun.com>
parents: 527
diff changeset
303 if (fullname[author])
6f7abc0e1f10 Add -i, -l, -t.
Paul Eggert <eggert@twinsun.com>
parents: 527
diff changeset
304 printf "%s (%s@%s)\n\n", fullname[author], author, "'"$hostname"'"
6f7abc0e1f10 Add -i, -l, -t.
Paul Eggert <eggert@twinsun.com>
parents: 527
diff changeset
305 else
6f7abc0e1f10 Add -i, -l, -t.
Paul Eggert <eggert@twinsun.com>
parents: 527
diff changeset
306 printf "%s\n\n", author
527
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
307 }
534
6f7abc0e1f10 Add -i, -l, -t.
Paul Eggert <eggert@twinsun.com>
parents: 527
diff changeset
308 if (! filesknown[$1]) {
6f7abc0e1f10 Add -i, -l, -t.
Paul Eggert <eggert@twinsun.com>
parents: 527
diff changeset
309 filesknown[$1] = 1
594
efa0c124c178 Add clumpname support.
Paul Eggert <eggert@twinsun.com>
parents: 535
diff changeset
310 if (files == "") files = " " $1
efa0c124c178 Add clumpname support.
Paul Eggert <eggert@twinsun.com>
parents: 535
diff changeset
311 else files = files ", " $1
534
6f7abc0e1f10 Add -i, -l, -t.
Paul Eggert <eggert@twinsun.com>
parents: 527
diff changeset
312 }
527
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
313 }
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
314 END {
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
315 # Print the last log.
594
efa0c124c178 Add clumpname support.
Paul Eggert <eggert@twinsun.com>
parents: 535
diff changeset
316 if (date != "") {
efa0c124c178 Add clumpname support.
Paul Eggert <eggert@twinsun.com>
parents: 535
diff changeset
317 '"$printlogline"'
efa0c124c178 Add clumpname support.
Paul Eggert <eggert@twinsun.com>
parents: 535
diff changeset
318 printf "\n"
efa0c124c178 Add clumpname support.
Paul Eggert <eggert@twinsun.com>
parents: 535
diff changeset
319 }
527
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
320 }
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
321 ' &&
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
322
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
323
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
324 # Exit successfully.
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
325
703fd28f892d Initial revision
Paul Eggert <eggert@twinsun.com>
parents:
diff changeset
326 exec rm -f $rlogout