Diff for /CVSROOT/cvs2rss.pl between versions 1.2 and 1.7

version 1.2, 2005/10/11 22:11:16 version 1.7, 2005/10/17 19:50:57
Line 46  my $description; Line 46  my $description;
 my @title=split(",",$ARGV[0]);  my @title=split(",",$ARGV[0]);
   
 my $rss = new XML::RSS(version => '2.0');  my $rss = new XML::RSS(version => '2.0');
   
   # If rssFeed exists, parse it
   if (-r "$rssFeed") {
    $rss->parsefile($rssFeed);
   }
   
 $rss->channel(  $rss->channel(
  title=> $channelTitle,   title=> $channelTitle,
  link => $channelLink,   link => $channelLink,
  language => 'en',   language => 'en',
  description => $channelTitle,   description => $channelTitle,
  copyright => '(c) 2005 MSU Board of Trustees.'   copyright => '(c) 2005 MSU Board of Trustees.',
    pubDate => $pubDate 
 );  );
   
 # If rssFeed exists, parse it  
 if (-r "$rssFeed") {  
  $rss->parsefile($rssFeed);  
 }  
   
 # Limit entries in the feed to $numEntries  # Limit entries in the feed to $numEntries
 pop(@{$rss->{'items'}}) while (@{$rss->{'items'}} >= $numEntries);  pop(@{$rss->{'items'}}) while (@{$rss->{'items'}} >= $numEntries);
Line 70  $title[0] =~s/ /\//; Line 73  $title[0] =~s/ /\//;
 while (<STDIN>) {  while (<STDIN>) {
  chomp($_);   chomp($_);
  if ($_=~/^[A-Z].*:\s*$/) {   if ($_=~/^[A-Z].*:\s*$/) {
  $_ = "<br /><b>" . $_ . "</b><br />";   $_ = "<br /><b>" . &HTML::Entities::encode($_,'<>&"') . "</b><br />";
  }   }
  else {   else {
    $_ = &HTML::Entities::encode($_,'<>&"');
  $_ .= "<br />";   $_ .= "<br />";
  }   }
  $description .= $_;   $description .= $_;
Line 84  if ($cvsDiff == 1) { Line 88  if ($cvsDiff == 1) {
   
  if (($title[1] != "NONE") && ($title[0]=~/(.*).(pm)$/)){   if (($title[1] != "NONE") && ($title[0]=~/(.*).(pm)$/)){
  my $tmpFile = "/tmp/diff.$$";   my $tmpFile = "/tmp/diff.$$";
  my $cmdLine = "cvs -n rdiff -kk -r " . $title[1] .  " -r " . $title[2] . " " . $title[0] . ">" . $tmpFile;   my $cmdLine = "cvs -n rdiff -u -kk -r " . $title[1] .  " -r " . $title[2] . " " . $title[0] . ">" . $tmpFile;
  system($cmdLine);   system($cmdLine);
   
  $description .= "<br /><b>Differences:</b><br /><pre>";   $description .= "<br /><b>Differences:</b><br /><pre>";
Line 100  if ($cvsDiff == 1) { Line 104  if ($cvsDiff == 1) {
 $rss->add_item(  $rss->add_item(
  title => "/" . $title[0] . " - " . $title[1] . "/" . $title[2],   title => "/" . $title[0] . " - " . $title[1] . "/" . $title[2],
  author => $author,   author => $author,
  pubDate => $pubDate,   
  description=> $description,   description=> $description,
  mode => 'insert'   mode => 'insert',
    pubDate => $pubDate,
    link => 'http://install.loncapa.org/cgi-bin/cvsweb.cgi/'.$title[0].'.diff?r1='.$title[1].';r2='.$title[2].';f=h'
 );  );
   
 foreach my $element (@{$rss->{'items'}}) {  foreach my $element (@{$rss->{'items'}}) {

Removed from v.1.2  
changed lines
  Added in v.1.7


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>