[LON-CAPA-cvs] cvs: CVSROOT / cvs2rss.pl

albertel lon-capa-cvs@mail.lon-capa.org
Mon, 24 Oct 2005 21:57:12 -0000


albertel		Mon Oct 24 17:57:12 2005 EDT

  Modified files:              
    /CVSROOT	cvs2rss.pl 
  Log:
  - need to echo the commit message
  
  
Index: CVSROOT/cvs2rss.pl
diff -u CVSROOT/cvs2rss.pl:1.9 CVSROOT/cvs2rss.pl:1.10
--- CVSROOT/cvs2rss.pl:1.9	Mon Oct 24 17:53:20 2005
+++ CVSROOT/cvs2rss.pl	Mon Oct 24 17:57:12 2005
@@ -42,8 +42,6 @@
 my $author = getpwuid(getuid()) . "\@" . $emailDomain;
 $author = 'guy' . "\@" . 'albertelli.com';
 my $pubDate = strftime('%a, %d %b %Y %H:%M:%S %Z',localtime(time));
-my $description;
-
 
 my @args = split(" ", $ARGV[0]);
 # bail when this is a new directory
@@ -71,25 +69,27 @@
 # Limit entries in the feed to $numEntries
 pop(@{$rss->{'items'}}) while (@{$rss->{'items'}} >= $numEntries);
 
+my $commit_msg;
+while (<STDIN>) {
+    chomp($_);
+    if ($_=~/^[A-Z].*:\s*$/) {
+	$_ = "<br /><b>" . &HTML::Entities::encode($_,'<>&"') . "</b><br />";
+    } else {
+	$_ = &HTML::Entities::encode($_,'<>&"');
+	$_ .= "<br />";
+    }
+    $commit_msg .= $_;
+}
+
 foreach my $file (@args) {
     my @title=split(",",$file);
 
-
+    my $description = $commit_msg;
     # Format title of the rss item
     # Remove space, append / and set title to /file/that/changed - oldversion/newversion
     $title[0] =~s/ /\//;
     
     # Format the cvslog msg itself
-    while (<STDIN>) {
-	chomp($_);
-	if ($_=~/^[A-Z].*:\s*$/) {
-	    $_ = "<br /><b>" . &HTML::Entities::encode($_,'<>&"') . "</b><br />";
-	} else {
-	    $_ = &HTML::Entities::encode($_,'<>&"');
-	    $_ .= "<br />";
-	}
-	$description .= $_;
-    }
 
     if ($cvsDiff == 1) {