Commit 49634f3bf221cc1939abafc788f7e4e31293fe73

jsm 1998-10-01T22:08:35

Add standard setup.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
diff --git a/CVSROOT/auto_checkout b/CVSROOT/auto_checkout
new file mode 100755
index 0000000..3412cf8
--- /dev/null
+++ b/CVSROOT/auto_checkout
@@ -0,0 +1,25 @@
+#!/bin/sh
+
+/bin/date
+
+# cvs only substitutes one % format character in the log_info line,
+# so we have to do both the update-mailing and the cvs update in this
+# script.  commit_prep and log_accum do not correctly find each other
+# when we run log_accum from this script (It looks like the magic
+# filename they use in /tmp has a pid or something that get confused
+# when log_accum is run from here), so we just send out a bogus little
+# by-hand update note.
+
+REPONAME=`echo $1 | sed -e 's,/www/sourceware/htdocs/,,' -e 's,/.*$,,'`
+echo Files modified in the $REPONAME repository. | 
+  /bin/mail -s "$2" green@cygnus.com jsm@cygnus.com
+
+
+# try to avoid a race (this kludge from the cvs docs!)
+/bin/sleep 2
+cd $1
+
+# $1 is of the format "DIRECTORYNAME FILENAME" with no final slash on DNAME.
+
+DIRNAME=`echo $2 | sed -e 's, .*,,' -e 's,^htdocs$,.,' -e 's,htdocs,.,'`
+/usr/local/bin/cvs -q update -d -P -l $DIRNAME
diff --git a/CVSROOT/checkoutlist b/CVSROOT/checkoutlist
index b04b350..cbafb14 100644
--- a/CVSROOT/checkoutlist
+++ b/CVSROOT/checkoutlist
@@ -11,3 +11,7 @@
 #	[<whitespace>]<filename><whitespace><error message><end-of-line>
 #
 # comment lines begin with '#'
+readers         Won't be able to control read-only access.
+commit_prep     Won't be able to do mail logging.
+log_accum       Won't be able to do mail logging.
+auto_checkout   Won't be able to maintain checked-out copies.
diff --git a/CVSROOT/commit_prep b/CVSROOT/commit_prep
new file mode 100755
index 0000000..986b509
--- /dev/null
+++ b/CVSROOT/commit_prep
@@ -0,0 +1,216 @@
+#!/usr/bin/perl
+# -*-Perl-*-
+#
+# $Id: commit_prep,v 1.1 1998/10/01 15:21:07 jsm Exp $
+#
+# Perl filter to handle pre-commit checking of files.  This program
+# records the last directory where commits will be taking place for
+# use by the log_accum.pl script.  For new files, it forces the
+# existence of a RCS "Id" keyword in the first ten lines of the file.
+# For existing files, it checks version number in the "Id" line to
+# prevent losing changes because an old version of a file was copied
+# into the direcory.
+#
+# Possible future enhancements:
+#
+#    Check for cruft left by unresolved conflicts.  Search for
+#    "^<<<<<<<$", "^-------$", and "^>>>>>>>$".
+#
+#    Look for a copyright and automagically update it to the
+#    current year.  [[ bad idea!  -- woods ]]
+#
+#
+# Contributed by David Hampton <hampton@cisco.com>
+#
+# Hacked on lots by Greg A. Woods <woods@web.net>
+
+#
+#	Configurable options
+#
+
+# Constants (remember to protect strings from RCS keyword substitution)
+#
+$LAST_FILE     = "/tmp/#libfficvs.lastdir"; # must match name in log_accum.pl
+$ENTRIES       = "CVS/Entries";
+
+# Patterns to find $Log keywords in files
+#
+$LogString1 = "\\\$\\Log: .* \\\$";
+$LogString2 = "\\\$\\Log\\\$";
+$NoLog = "%s - contains an RCS \$Log keyword.  It must not!\n";
+
+# pattern to match an RCS Id keyword line with an existing ID
+#
+$IDstring = "\"@\\(#\\)[^:]*:.*\\\$\Id: .*\\\$\"";
+$NoId = "
+%s - Does not contain a properly formatted line with the keyword \"Id:\".
+	I.e. no lines match \"" . $IDstring . "\".
+	Please see the template files for an example.\n";
+
+# pattern to match an RCS Id keyword line for a new file (i.e. un-expanded)
+#
+$NewId = "\"@(#)[^:]*:.*\\$\Id\\$\"";
+
+$NoName = "
+%s - The ID line should contain only \"@(#)module/path:\$Name\$:\$\Id\$\"
+	for a newly created file.\n";
+
+$BadName = "
+%s - The file name '%s' in the ID line does not match
+	the actual filename.\n";
+
+$BadVersion = "
+%s - How dare you!!!  You replaced your copy of the file '%s',
+	which was based upon version %s, with an %s version based
+	upon %s.  Please move your '%s' out of the way, perform an
+	update to get the current version, and them merge your changes
+	into that file, then try the commit again.\n";
+
+#
+#	Subroutines
+#
+
+sub write_line {
+    local($filename, $line) = @_;
+    open(FILE, ">$filename") || die("Cannot open $filename, stopped");
+    print(FILE $line, "\n");
+    close(FILE);
+}
+
+sub check_version {
+    local($i, $id, $rname, $version);
+    local($filename, $cvsversion) = @_;
+
+    open(FILE, "<$filename") || return(0);
+
+    @all_lines = ();
+    $idpos = -1;
+    $newidpos = -1;
+    for ($i = 0; <FILE>; $i++) {
+	chop;
+	push(@all_lines, $_);
+	if ($_ =~ /$IDstring/) {
+	    $idpos = $i;
+	}
+	if ($_ =~ /$NewId/) {
+	    $newidpos = $i;
+	}
+    }
+
+    if (grep(/$LogString1/, @all_lines) || grep(/$LogString2/, @all_lines)) {
+	print STDERR sprintf($NoLog, $filename);
+	return(1);
+    }
+
+    if ($debug != 0) {
+	print STDERR sprintf("file = %s, version = %d.\n", $filename, $cvsversion{$filename});
+    }
+
+    if ($cvsversion{$filename} == 0) {
+	if ($newidpos != -1 && $all_lines[$newidpos] !~ /$NewId/) {
+	    print STDERR sprintf($NoName, $filename);
+	    return(1);
+	}
+	return(0);
+    }
+
+    if ($idpos == -1) {
+	print STDERR sprintf($NoId, $filename);
+	return(1);
+    }
+
+    $line = $all_lines[$idpos];
+    $pos = index($line, "Id: ");
+    if ($debug != 0) {
+	print STDERR sprintf("%d in '%s'.\n", $pos, $line);
+    }
+    ($id, $rname, $version) = split(' ', substr($line, $pos));
+    if ($rname ne "$filename,v") {
+	print STDERR sprintf($BadName, $filename, substr($rname, 0, length($rname)-2));
+	return(1);
+    }
+    if ($cvsversion{$filename} < $version) {
+	print STDERR sprintf($BadVersion, $filename, $filename, $cvsversion{$filename},
+			     "newer", $version, $filename);
+	return(1);
+    }
+    if ($cvsversion{$filename} > $version) {
+	print STDERR sprintf($BadVersion, $filename, $filename, $cvsversion{$filename},
+			     "older", $version, $filename);
+	return(1);
+    }
+    return(0);
+}
+
+#
+#	Main Body	
+#
+
+$id = getpgrp();		# You *must* use a shell that does setpgrp()!
+
+# Check each file (except dot files) for an RCS "Id" keyword.
+#
+$check_id = 0;
+
+# Record the directory for later use by the log_accumulate stript.
+#
+$record_directory = 0;
+
+# parse command line arguments
+#
+while (@ARGV) {
+    $arg = shift @ARGV;
+
+    if ($arg eq '-d') {
+	$debug = 1;
+	print STDERR "Debug turned on...\n";
+    } elsif ($arg eq '-c') {
+	$check_id = 1;
+    } elsif ($arg eq '-r') {
+	$record_directory = 1;
+    } else {
+	push(@files, $arg);
+    }
+}
+
+$directory = shift @files;
+
+if ($debug != 0) {
+    print STDERR "dir   - ", $directory, "\n";
+    print STDERR "files - ", join(":", @files), "\n";
+    print STDERR "id    - ", $id, "\n";
+}
+
+# Suck in the CVS/Entries file
+#
+open(ENTRIES, $ENTRIES) || die("Cannot open $ENTRIES.\n");
+while (<ENTRIES>) {
+    local($filename, $version) = split('/', substr($_, 1));
+    $cvsversion{$filename} = $version;
+}
+
+# Now check each file name passed in, except for dot files.  Dot files
+# are considered to be administrative files by this script.
+#
+if ($check_id != 0) {
+    $failed = 0;
+    foreach $arg (@files) {
+	if (index($arg, ".") == 0) {
+	    next;
+	}
+	$failed += &check_version($arg);
+    }
+    if ($failed) {
+	print STDERR "\n";
+	exit(1);
+    }
+}
+
+# Record this directory as the last one checked.  This will be used
+# by the log_accumulate script to determine when it is processing
+# the final directory of a multi-directory commit.
+#
+if ($record_directory != 0) {
+    &write_line("$LAST_FILE.$id", $directory);
+}
+exit(0);
diff --git a/CVSROOT/commitinfo b/CVSROOT/commitinfo
index b19e7b7..e4d205f 100644
--- a/CVSROOT/commitinfo
+++ b/CVSROOT/commitinfo
@@ -13,3 +13,5 @@
 #
 # If the name "ALL" appears as a regular expression it is always used
 # in addition to the first matching regex or "DEFAULT".
+
+DEFAULT         /usr/bin/perl $CVSROOT/CVSROOT/commit_prep -r
diff --git a/CVSROOT/cvswrappers b/CVSROOT/cvswrappers
index 5047bf1..f7f53b6 100644
--- a/CVSROOT/cvswrappers
+++ b/CVSROOT/cvswrappers
@@ -20,3 +20,11 @@
 #  and value is a single-quote delimited value.
 #
 # For example:
+
+# Automatically handle files that show up on web pages but are binary.
+*.jpg   -k 'b' -m 'COPY'
+*.jpeg  -k 'b' -m 'COPY'
+*.gif   -k 'b' -m 'COPY'
+*.gz    -k 'b' -m 'COPY'
+*.zip   -k 'b' -m 'COPY'
+*.png   -k 'b' -m 'COPY'
diff --git a/CVSROOT/log_accum b/CVSROOT/log_accum
new file mode 100755
index 0000000..728911c
--- /dev/null
+++ b/CVSROOT/log_accum
@@ -0,0 +1,589 @@
+#!/usr/bin/perl
+# -*-Perl-*-
+#
+# Perl filter to handle the log messages from the checkin of files in
+# a directory.  This script will group the lists of files by log
+# message, and mail a single consolidated log message at the end of
+# the commit.
+#
+# This file assumes a pre-commit checking program that leaves the
+# names of the first and last commit directories in a temporary file.
+#
+# Contributed by David Hampton <hampton@cisco.com>
+#
+# hacked greatly by Greg A. Woods <woods@web.net>
+
+# Usage: log_accum.pl [-d] [-s] [-M module] [[-m mailto] ...] [-f logfile]
+#	-d		- turn on debugging
+#	-m mailto	- send mail to "mailto" (multiple)
+#	-M modulename	- set module name to "modulename"
+#	-f logfile	- write commit messages to logfile too
+#	-s		- *don't* run "cvs status -v" for each file
+
+#
+#	Configurable options
+#
+
+# Set this to something that takes "-s"
+$MAILER	       = "/usr/unsupported/bin/ucbMail";
+
+# Constants (don't change these!)
+#
+$STATE_NONE    = 0;
+$STATE_CHANGED = 1;
+$STATE_ADDED   = 2;
+$STATE_REMOVED = 3;
+$STATE_LOG     = 4;
+
+$LAST_FILE     = "/tmp/#libfficvs.lastdir";
+
+$CHANGED_FILE  = "/tmp/#libffi.files.changed";
+$ADDED_FILE    = "/tmp/#libffi.files.added";
+$REMOVED_FILE  = "/tmp/#libffi.files.removed";
+$LOG_FILE      = "/tmp/#libffi.files.log";
+
+$FILE_PREFIX   = "#libffi.files";
+
+#
+#	Subroutines
+#
+
+sub cleanup_tmpfiles {
+    local($wd, @files);
+
+    $wd = `pwd`;
+    chdir("/tmp") || die("Can't chdir('/tmp')\n");
+    opendir(DIR, ".");
+    push(@files, grep(/^$FILE_PREFIX\..*\.$id$/, readdir(DIR)));
+    closedir(DIR);
+    foreach (@files) {
+	unlink $_;
+    }
+    unlink $LAST_FILE . "." . $id;
+
+    chdir($wd);
+}
+
+sub write_logfile {
+    local($filename, @lines) = @_;
+
+    open(FILE, ">$filename") || die("Cannot open log file $filename.\n");
+    print FILE join("\n", @lines), "\n";
+    close(FILE);
+}
+
+sub format_names {
+    local($dir, @files) = @_;
+    local(@lines);
+
+    if ($dir =~ /^\.\//) {
+	$dir = $';
+    }
+    if ($dir =~ /\/$/) {
+	$dir = $`;
+    }
+    if ($dir eq "") {
+	$dir = ".";
+    }
+
+    $format = "\t%-" . sprintf("%d", length($dir) > 15 ? length($dir) : 15) . "s%s ";
+
+    $lines[0] = sprintf($format, $dir, ":");
+
+    if ($debug) {
+	print STDERR "format_names(): dir = ", $dir, "; files = ", join(":", @files), ".\n";
+    }
+    foreach $file (@files) {
+	if (length($lines[$#lines]) + length($file) > 65) {
+	    $lines[++$#lines] = sprintf($format, " ", " ");
+	}
+	$lines[$#lines] .= $file . " ";
+    }
+
+    @lines;
+}
+
+sub format_lists {
+    local(@lines) = @_;
+    local(@text, @files, $lastdir);
+
+    if ($debug) {
+	print STDERR "format_lists(): ", join(":", @lines), "\n";
+    }
+    @text = ();
+    @files = ();
+    $lastdir = shift @lines;	# first thing is always a directory
+    if ($lastdir !~ /.*\/$/) {
+	die("Damn, $lastdir doesn't look like a directory!\n");
+    }
+    foreach $line (@lines) {
+	if ($line =~ /.*\/$/) {
+	    push(@text, &format_names($lastdir, @files));
+	    $lastdir = $line;
+	    @files = ();
+	} else {
+	    push(@files, $line);
+	}
+    }
+    push(@text, &format_names($lastdir, @files));
+
+    @text;
+}
+
+sub accum_subject {
+    local(@lines) = @_;
+    local(@files, $lastdir);
+
+    $lastdir = shift @lines;	# first thing is always a directory
+    @files = ($lastdir);
+    if ($lastdir !~ /.*\/$/) {
+	die("Damn, $lastdir doesn't look like a directory!\n");
+    }
+    foreach $line (@lines) {
+	if ($line =~ /.*\/$/) {
+	    $lastdir = $line;
+	    push(@files, $line);
+	} else {
+	    push(@files, $lastdir . $line);
+	}
+    }
+
+    @files;
+}
+
+sub compile_subject {
+    local(@files) = @_;
+    local($text, @a, @b, @c, $dir, $topdir);
+
+    # find the highest common directory
+    $dir = '-';
+    do {
+	$topdir = $dir;
+	foreach $file (@files) {
+	    if ($file =~ /.*\/$/) {
+		if ($dir eq '-') {
+		    $dir = $file;
+		} else {
+		    if (index($dir,$file) == 0) {
+			$dir = $file;
+		    } elsif (index($file,$dir) != 0) {
+			@a = split /\//,$file;
+			@b = split /\//,$dir;
+			@c = ();
+			CMP: while ($#a > 0 && $#b > 0) {
+			    if ($a[0] eq $b[0]) {
+				push(@c, $a[0]);
+				shift @a;
+				shift @b;
+			    } else {
+				last CMP;
+			    }
+			}
+			$dir = join('/',@c) . '/';
+		    }
+		}
+	    }
+	}
+    } until $dir eq $topdir;
+
+    # strip out directories and the common prefix topdir.
+    chop $topdir;
+    @c = ($modulename . '/' . $topdir);
+    foreach $file (@files) {
+	if (!($file =~ /.*\/$/)) {
+	    push(@c, substr($file, length($topdir)+1));
+	}
+    }
+
+    # put it together and limit the length.
+    $text = join(' ',@c);
+    if (length($text) > 50) {
+	$text = substr($text, 0, 46) . ' ...';
+    }
+
+    $text;
+}
+
+sub append_names_to_file {
+    local($filename, $dir, @files) = @_;
+
+    if (@files) {
+	open(FILE, ">>$filename") || die("Cannot open file $filename.\n");
+	print FILE $dir, "\n";
+	print FILE join("\n", @files), "\n";
+	close(FILE);
+    }
+}
+
+sub read_line {
+    local($line);
+    local($filename) = @_;
+
+    open(FILE, "<$filename") || die("Cannot open file $filename.\n");
+    $line = <FILE>;
+    close(FILE);
+    chop($line);
+    $line;
+}
+
+sub read_logfile {
+    local(@text);
+    local($filename, $leader) = @_;
+
+    open(FILE, "<$filename");
+    while (<FILE>) {
+	chop;
+	push(@text, $leader.$_);
+    }
+    close(FILE);
+    @text;
+}
+
+sub build_header {
+    local($header);
+    local($sec,$min,$hour,$mday,$mon,$year) = localtime(time);
+    $header = sprintf("CVSROOT:\t%s\nModule name:\t%s\n",
+		      $cvsroot,
+		      $modulename);
+    if (defined($branch)) {
+	$header .= sprintf("Branch: \t%s\n",
+		      $branch);
+    }
+    $header .= sprintf("Changes by:\t%s@%s\t%02d/%02d/%02d %02d:%02d:%02d",
+		      $login, $hostdomain,
+		      $year%100, $mon+1, $mday,
+		      $hour, $min, $sec);
+}
+
+sub mail_notification {
+    local($name, $subject, @text) = @_;
+    open(MAIL, "| $MAILER -s \"$subject\" $name");
+    print MAIL join("\n", @text), "\n";
+    close(MAIL);
+}
+
+sub write_commitlog {
+    local($logfile, @text) = @_;
+
+    open(FILE, ">>$logfile");
+    print FILE join("\n", @text), "\n\n";
+    close(FILE);
+}
+
+#
+#	Main Body
+#
+
+# Initialize basic variables
+#
+$debug = 0;
+$id = getpgrp();		# note, you *must* use a shell which does setpgrp()
+$state = $STATE_NONE;
+$login = $ENV{'USER'} || (getpwuid($<))[0] || "nobody";
+chop($hostname = `hostname`);
+if ($hostname !~ /\./) {
+    chop($domainname = `domainname`);
+    $hostdomain = $hostname . "." . $domainname;
+} else {
+    $hostdomain = $hostname;
+}
+$cvsroot = $ENV{'CVSROOT'};
+$do_status = 1;
+$modulename = "";
+
+# parse command line arguments (file list is seen as one arg)
+#
+while (@ARGV) {
+    $arg = shift @ARGV;
+
+    if ($arg eq '-d') {
+	$debug = 1;
+	print STDERR "Debug turned on...\n";
+    } elsif ($arg eq '-m') {
+	$mailto = "$mailto " . shift @ARGV;
+    } elsif ($arg eq '-M') {
+	$modulename = shift @ARGV;
+    } elsif ($arg eq '-s') {
+	$do_status = 0;
+    } elsif ($arg eq '-f') {
+	($commitlog) && die("Too many '-f' args\n");
+	$commitlog = shift @ARGV;
+    } else {
+	($donefiles) && die("Too many arguments!  Check usage.\n");
+	$donefiles = 1;
+	@files = split(/ /, $arg);
+    }
+}
+($mailto) || die("No -m mail recipient specified\n");
+
+# for now, the first "file" is the repository directory being committed,
+# relative to the $CVSROOT location
+#
+@path = split('/', $files[0]);
+
+# XXX there are some ugly assumptions in here about module names and
+# XXX directories relative to the $CVSROOT location -- really should
+# XXX read $CVSROOT/CVSROOT/modules, but that's not so easy to do, since
+# XXX we have to parse it backwards.
+#
+if ($modulename eq "") {
+    $modulename = $path[0];	# I.e. the module name == top-level dir
+}
+if ($commitlog ne "") {
+    $commitlog = $cvsroot . "/" . $modulename . "/" . $commitlog unless ($commitlog =~ /^\//);
+}
+if ($#path == 0) {
+    $dir = ".";
+} else {
+    $dir = join('/', @path[1..$#path]);
+}
+$dir = $dir . "/";
+
+if ($debug) {
+    print STDERR "module - ", $modulename, "\n";
+    print STDERR "dir    - ", $dir, "\n";
+    print STDERR "path   - ", join(":", @path), "\n";
+    print STDERR "files  - ", join(":", @files), "\n";
+    print STDERR "id     - ", $id, "\n";
+}
+
+# Check for a new directory first.  This appears with files set as follows:
+#
+#    files[0] - "path/name/newdir"
+#    files[1] - "-"
+#    files[2] - "New"
+#    files[3] - "directory"
+#
+if ($files[2] =~ /New/ && $files[3] =~ /directory/) {
+    local(@text);
+
+    @text = ();
+    push(@text, &build_header());
+    push(@text, "");
+    push(@text, $files[0]);
+    push(@text, "");
+
+    while (<STDIN>) {
+	chop;			# Drop the newline
+	push(@text, $_);
+    }
+
+    &mail_notification($mailto, $files[0], @text);
+
+    if ($commitlog) {
+	&write_commitlog($commitlog, @text);
+    }
+
+    exit 0;
+}
+
+# Iterate over the body of the message collecting information.
+#
+while (<STDIN>) {
+    chop;			# Drop the newline
+
+    if (/^Modified Files/) { $state = $STATE_CHANGED; next; }
+    if (/^Added Files/)    { $state = $STATE_ADDED;   next; }
+    if (/^Removed Files/)  { $state = $STATE_REMOVED; next; }
+    if (/^Log Message/)    { $state = $STATE_LOG;     next; }
+    if (/^Revision\/Branch/) { /^[^:]+:\s*(.*)/; $branch = $+; next; }
+
+    s/^[ \t\n]+//;		# delete leading whitespace
+    s/[ \t\n]+$//;		# delete trailing whitespace
+    
+    if ($state == $STATE_CHANGED) { push(@changed_files, split); }
+    if ($state == $STATE_ADDED)   { push(@added_files,   split); }
+    if ($state == $STATE_REMOVED) { push(@removed_files, split); }
+    if ($state == $STATE_LOG)     { push(@log_lines,     $_); }
+}
+
+# Strip leading and trailing blank lines from the log message.  Also
+# compress multiple blank lines in the body of the message down to a
+# single blank line.
+#
+while ($#log_lines > -1) {
+    last if ($log_lines[0] ne "");
+    shift(@log_lines);
+}
+while ($#log_lines > -1) {
+    last if ($log_lines[$#log_lines] ne "");
+    pop(@log_lines);
+}
+for ($i = $#log_lines; $i > 0; $i--) {
+    if (($log_lines[$i - 1] eq "") && ($log_lines[$i] eq "")) {
+	splice(@log_lines, $i, 1);
+    }
+}
+
+# Check for an import command.  This appears with files set as follows:
+#
+#    files[0] - "path/name"
+#    files[1] - "-"
+#    files[2] - "Imported"
+#    files[3] - "sources"
+#
+if ($files[2] =~ /Imported/ && $files[3] =~ /sources/) {
+    local(@text);
+
+    @text = ();
+    push(@text, &build_header());
+    push(@text, "");
+
+    push(@text, "Log message:");
+    while ($#log_lines > -1) {
+	push (@text, "    " . $log_lines[0]);
+	shift(@log_lines);
+    }
+
+    &mail_notification($mailto, "Import $file[0]", @text);
+
+    if ($commitlog) {
+	&write_commitlog($commitlog, @text);
+    }
+
+    exit 0;
+}
+
+if ($debug) {
+    print STDERR "Searching for log file index...";
+}
+# Find an index to a log file that matches this log message
+#
+for ($i = 0; ; $i++) {
+    local(@text);
+
+    last if (! -e "$LOG_FILE.$i.$id"); # the next available one
+    @text = &read_logfile("$LOG_FILE.$i.$id", "");
+    last if ($#text == -1);	# nothing in this file, use it
+    last if (join(" ", @log_lines) eq join(" ", @text)); # it's the same log message as another
+}
+if ($debug) {
+    print STDERR " found log file at $i.$id, now writing tmp files.\n";
+}
+
+# Spit out the information gathered in this pass.
+#
+&append_names_to_file("$CHANGED_FILE.$i.$id", $dir, @changed_files);
+&append_names_to_file("$ADDED_FILE.$i.$id",   $dir, @added_files);
+&append_names_to_file("$REMOVED_FILE.$i.$id", $dir, @removed_files);
+&write_logfile("$LOG_FILE.$i.$id", @log_lines);
+
+# Check whether this is the last directory.  If not, quit.
+#
+if ($debug) {
+    print STDERR "Checking current dir against last dir.\n";
+}
+$_ = &read_line("$LAST_FILE.$id");
+
+if ($_ ne $cvsroot . "/" . $files[0]) {
+    if ($debug) {
+	print STDERR sprintf("Current directory %s is not last directory %s.\n", $cvsroot . "/" .$files[0], $_);
+    }
+    exit 0;
+}
+if ($debug) {
+    print STDERR sprintf("Current directory %s is last directory %s -- all commits done.\n", $files[0], $_);
+}
+
+#
+#	End Of Commits!
+#
+
+# This is it.  The commits are all finished.  Lump everything together
+# into a single message, fire a copy off to the mailing list, and drop
+# it on the end of the Changes file.
+#
+
+#
+# Produce the final compilation of the log messages
+#
+@text = ();
+@status_txt = ();
+@subject_files = ();
+push(@text, &build_header());
+push(@text, "");
+
+for ($i = 0; ; $i++) {
+    last if (! -e "$LOG_FILE.$i.$id"); # we're done them all!
+    @lines = &read_logfile("$CHANGED_FILE.$i.$id", "");
+    if ($#lines >= 0) {
+	push(@text, "Modified files:");
+	push(@text, &format_lists(@lines));
+	push(@subject_files, &accum_subject(@lines));
+    }
+    @lines = &read_logfile("$ADDED_FILE.$i.$id", "");
+    if ($#lines >= 0) {
+	push(@text, "Added files:");
+	push(@text, &format_lists(@lines));
+	push(@subject_files, &accum_subject(@lines));
+    }
+    @lines = &read_logfile("$REMOVED_FILE.$i.$id", "");
+    if ($#lines >= 0) {
+	push(@text, "Removed files:");
+	push(@text, &format_lists(@lines));
+	push(@subject_files, &accum_subject(@lines));
+    }
+    if ($#text >= 0) {
+	push(@text, "");
+    }
+    @lines = &read_logfile("$LOG_FILE.$i.$id", "\t");
+    if ($#lines >= 0) {
+	push(@text, "Log message:");
+	push(@text, @lines);
+	push(@text, "");
+    }
+    if ($do_status) {
+	local(@changed_files);
+
+	@changed_files = ();
+	push(@changed_files, &read_logfile("$CHANGED_FILE.$i.$id", ""));
+	push(@changed_files, &read_logfile("$ADDED_FILE.$i.$id", ""));
+	push(@changed_files, &read_logfile("$REMOVED_FILE.$i.$id", ""));
+
+	if ($debug) {
+	    print STDERR "main: pre-sort changed_files = ", join(":", @changed_files), ".\n";
+	}
+	sort(@changed_files);
+	if ($debug) {
+	    print STDERR "main: post-sort changed_files = ", join(":", @changed_files), ".\n";
+	}
+
+	foreach $dofile (@changed_files) {
+	    if ($dofile =~ /\/$/) {
+		next;		# ignore the silly "dir" entries
+	    }
+	    if ($debug) {
+		print STDERR "main(): doing status on $dofile\n";
+	    }
+	    open(STATUS, "-|") || exec 'cvs', '-n', 'status', '-Qqv', $dofile;
+	    while (<STATUS>) {
+		chop;
+		push(@status_txt, $_);
+	    }
+	}
+    }
+}
+
+$subject_txt = &compile_subject(@subject_files);
+
+# Write to the commitlog file
+#
+if ($commitlog) {
+    &write_commitlog($commitlog, @text);
+}
+
+if ($#status_txt >= 0) {
+    push(@text, @status_txt);
+}
+
+# Mailout the notification.
+#
+&mail_notification($mailto, $subject_txt, @text);
+
+# cleanup
+#
+if (! $debug) {
+    &cleanup_tmpfiles();
+}
+
+exit 0;
diff --git a/CVSROOT/loginfo b/CVSROOT/loginfo
index 5a59f0a..6921054 100644
--- a/CVSROOT/loginfo
+++ b/CVSROOT/loginfo
@@ -24,3 +24,6 @@
 #DEFAULT (echo ""; id; echo %s; date; cat) >> $CVSROOT/CVSROOT/commitlog
 # or
 #DEFAULT (echo ""; id; echo %{sVv}; date; cat) >> $CVSROOT/CVSROOT/commitlog
+^htdocs ($CVSROOT/CVSROOT/auto_checkout /www/sourceware/htdocs/libffi %s >> $CVSROOT/CVSROOT/updatelog 2>&1 &)
+
+DEFAULT /usr/bin/perl $CVSROOT/CVSROOT/log_accum -m green@cygnus.com -m jsm@cygnus.com -s %s