p4_labels_2_html #3

  • //
  • guest/
  • barrie_slaymaker/
  • safari/
  • src/
  • conf/
  • bin/
  • p4_labels_2_html
  • View
  • Commits
  • Open Download .zip Download (1010 B)
#!/usr/bin/perl -w

#
# p4_labels_2_html for Safari
# Copyright (c) 1999 by Barrie Slaymaker, [email protected]
#
# You may distribute under the terms of either the GNU General Public
# License or the Artistic License, as specified in the README file.
#

use strict ;

my $up_to_project = $ENV{SAF_UP_TO_PROJECT} ;

my @output ;
while (<>) {
   s/&/&amp;/g ;
   s/</&lt;/g ;
   s/>/&gt;/g ;
   chomp ;
   if ( m/(Label\s+)(\S+)\s+(\S+)\s+(?:'\s*)?([^'].*?)\s*'?\s*$/ )
   {
      $_ = qq(<TR><TD>$2</TD><TD>[ <A HREF="$up_to_project\@$2/Default/">Browse</A> ]</TD><TD>$3</TD><TD>$4</TD></TR>) ;
   }
   else {
      $_ = qq(<TR><TD><BR></TD><TD><BR></TD><TD><BR></TD><TD>$_</TD></TR>) ;
   }
   push( @output, $_ ) ;
}

print <<TOHERE ;
<HTML>
<HEAD>
   <TITLE>Labels</TITLE>
</HEAD>
<BODY>
<TABLE>
   <TR><TH ALIGN="LEFT">Label</TH><TH><BR></TH><TH ALIGN="LEFT">Date</TH><TH ALIGN="LEFT">Description</TH></TR>
TOHERE

print( map{ $_ .= "\n" } @output ) ;

print <<TOHERE ;
</TABLE>
</BODY>
</HTML>
TOHERE

0 ;
# Change User Description Committed
#3 168 Barrie Slaymaker Added YAPC paper, slides
#2 165 Barrie Slaymaker Applied Greg KH's license patch.
#1 162 Barrie Slaymaker First code & documentation checkin