[docs] xmldocs - docelic modified bin/whatsnew-update

docs at icdevgroup.org docs at icdevgroup.org
Sat Dec 4 18:54:21 EST 2004


User:      docelic
Date:      2004-12-04 23:54:21 GMT
Modified:  bin      whatsnew-update
Log:
- bin/whatsnew-update:
 - NEW script
 - You should stuff ic-cvs mailing list messages to ./whatsnew/ml/ directory.
   This script will pick up the files, read commit messages and update the
   whatsnew.xml file.

	 No risk of endless loop - changes to xmldocs go to 'docs' list, not again
   to ic-cvs.

   This works now! Copy few sample mails from -cvs ML to the mentioned
	 directory and run:
   perl bin/whatsnew-update

   And enjoy the beauty in whatsnew/whatsnew.xml ;-)

Revision  Changes    Path
1.2       +28 -2     xmldocs/bin/whatsnew-update


rev 1.2, prev_rev 1.1
Index: whatsnew-update
===================================================================
RCS file: /var/cvs/xmldocs/bin/whatsnew-update,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- whatsnew-update	4 Dec 2004 23:35:16 -0000	1.1
+++ whatsnew-update	4 Dec 2004 23:54:21 -0000	1.2
@@ -23,6 +23,7 @@
 my $entry_string = "<!-- AUTO UPDATER -->";
 my @template = <DATA>;
 my $template = join "", @template;
+my $final_content;
 
 unless ( GetOptions ( 
 	"verbose|v!" => \$verbose,
@@ -44,13 +45,32 @@
 }
 close IN;
 
+# Read all messages and expand template for each
 for $_ (@archive) {
 	my ($user,$date,$log) = read_log($_);
 
 	my $sect = eval "\"$template\"";
+	$final_content .= $sect;
 	print "Here's a cookie:\n$sect\n";
 }
 
+# Finally, update .xml
+open IN, "< whatsnew/whatsnew.xml" or
+	die "Can't open whatsnew/whatsnew.xml ($!)\n";
+my @wn = <IN>;
+close IN;
+
+my $count = 0;
+for $_ (@wn) {
+	/^(\Q$entry_string\E)$/ and do {
+		$_ = "$entry_string\n$final_content";
+	}
+}
+
+open OUT, "> whatsnew/whatsnew.xml";
+print OUT @wn;
+close OUT;
+
 exit 0;
 
 ###################################################################
@@ -67,7 +87,7 @@
 	for $_ (@file) {
 		/^User:\s+(\S+)$/ and $user = $1;
 		/^Date:\s+(\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2} GMT)$/ and $date = $1;
-		/^Log:$/ and $run++;
+		/^Log:$/ and do { $run++; next };
 		/^Revision\s+Changes\s+Path$/ and $run=0;
 		$run and push @log, $_;
 	}
@@ -77,6 +97,12 @@
 
 
 __DATA__
-User: $user ($date)
+<literallayout>
+<emphasis>
+User: $user
+Date: $date
+</emphasis>
+
 @$log
+</literallayout>
 








More information about the docs mailing list