Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 8 Oct 1999 08:56:24 -0700 (MST)
From:      John Reynolds~ <jreynold@sedona.ch.intel.com>
To:        stable@freebsd.org
Subject:   Re: Seeing log messages associated with CVSup updates
Message-ID:  <14334.5160.352292.773239@hip186.ch.intel.com>
In-Reply-To: <37FDC033.F3B549A6@newsguy.com>
References:  <13641.991004@McFlySr.Kurgan.Ru> <199910071621.JAA47057@vashon.polstra.com> <37FDC033.F3B549A6@newsguy.com>

next in thread | previous in thread | raw e-mail | index | archive | help

[ On Friday, October 8, Daniel C. Sobral wrote: ]
> 
> This script is really cool, but it is still a little bit lacking. If
> we could have a link to the diff between the version you have and
> the latest version, that would be much better. It seems feasible,
> isn't it?
> 

Yes, most of the above seems feasible. There would be a little guesswork and
heuristics on the "linking to the diff" part, but the rest is pretty much done
by the following. The idea for this script, of course, was gleaned from the
original awk script posted by John Polstra yesterday.

Use at will, modify to suit your needs :)

#!/usr/bin/perl
#
#  Copyright (c) 1999 John C. Reynolds
#  All rights reserved.
# 
#  Redistribution and use in source and binary forms, with or without
#  modification, are permitted provided that the following conditions
#  are met:
#  1. Redistributions of source code must retain the above copyright
#     notice, this list of conditions, and the following disclaimer,
#     without modification, immediately at the beginning of the file.
#  2. The name of the author may not be used to endorse or promote products
#     derived from this software without specific prior written permission.
# 
#  THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
#  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
#  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
#  ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
#  ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
#  DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
#  OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
#  HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
#  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
#  OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
#  SUCH DAMAGE.
# 
#
#   Quickie script to reformat CVSup (16) log files into HTML. Links
#   references to files, deltas, and committers to the CVS web CGI program
#   and the FreeBSD web site.
#
#   The idea for this program originated from an 'awk' script created by
#   <Dom.Mitchell@palmerharvey.co.uk>, with other ideas and patches submitted
#   by Marcel Moolenaar <marcel@scc.nl>.
#
require 'ctime.pl';

$url     = 'http://www.freebsd.org/cgi/cvsweb.cgi';

if ($ARGV[0] eq '') {
    print "Usage: $0 cvsup-log-file > cvsup-log-file.html\n";
    exit 1;
}

# Grab date from file if not coming in from stdin
#
$date = '';
unless ($ARGV[0] eq '-') {
    ($dev, $ino, $mode, $nlink, $uid, $gid, 
     $rdev, $size, $atime, $mtime, @junk) = stat ($ARGV[0]);

    $date = ctime ($mtime);
    chomp ($date);
    $date = '(' . $date . ')';
}

if (! open (IN, $ARGV[0])) {
    print (STDERR "Could not open '$ARGV[0]' for reading - $!\n");
    exit 2;
}

while (<IN>) {
    if (/Parsing\s+supfile\s+"(.*?)"/) {
	$file = $1;
	s#$file#<A HREF="file:$file">$file</A>#;
    }

    if (/(Edit|Checkout)\s+(\S+)/) {
	$file = $2;
	($realfile = $file) =~ s/,v$//;
	s#$file#<A HREF="$url/$realfile">$file</A>#;
    }

    if (/Add\s+delta\s+(\S+).*?(\S+)\s*$/) {
	$rev = $1;
	$committer = $2;

	s#$rev#<A HREF="$url/${realfile}?rev=$rev">$rev</A>#;
	s#$committer#<A HREF="mailto:$committer\@freebsd.org">$committer</A>#;
    }

    if (/Updating\s+collection\s+(\S+)/) {
	$collection = $1;
    }

    push (@lines, $_);

}

close (IN);

print "<HTML>\n<HEAD>\n";
print "<TITLE>CVSup log for '$collection' ${date}</TITLE>\n</HEAD>\n";
print "<BODY>\n<PRE>\n\n";
foreach (@lines) {
    print;
}
print "</PRE>\n</BODY>\n</HTML>\n\n";



-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
| John Reynolds               CEG, CCE, Next Generation Flows, HLA          |
| Intel Corporation      MS: CH6-210   Phone: 480-554-9092   pgr: 868-6512  |
| jreynold@sedona.ch.intel.com  http://www-aec.ch.intel.com/~jreynold/      |
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-stable" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?14334.5160.352292.773239>