r935 - html/trunk/scripts

lizardo at linuxfromscratch.org lizardo at linuxfromscratch.org
Mon Jan 10 19:29:47 PST 2005


Author: lizardo
Date: 2005-01-10 20:29:42 -0700 (Mon, 10 Jan 2005)
New Revision: 935

Modified:
   html/trunk/scripts/manage_news.pl
   html/trunk/scripts/update-website.sh
Log:
Fixed news archives management.


Modified: html/trunk/scripts/manage_news.pl
===================================================================
--- html/trunk/scripts/manage_news.pl	2005-01-11 02:54:03 UTC (rev 934)
+++ html/trunk/scripts/manage_news.pl	2005-01-11 03:29:42 UTC (rev 935)
@@ -378,7 +378,7 @@
 
     Error("Invalid database filename. It should have the format news-YEAR.txt")
     unless $infile =~ /news-\d{4}\.txt/;
-    open(FILE, $infile);
+    open(FILE, $infile) or die "Cannot open \"$infile\": $!\n";
     while (<FILE>) {
         $cur_line++;
         if (/^(\s*)Content-Type:\s+multipart\/mixed;/i) {

Modified: html/trunk/scripts/update-website.sh
===================================================================
--- html/trunk/scripts/update-website.sh	2005-01-11 02:54:03 UTC (rev 934)
+++ html/trunk/scripts/update-website.sh	2005-01-11 03:29:42 UTC (rev 935)
@@ -48,10 +48,12 @@
 
 # Generate all archives
 # Add below the years to be archived
-for y in 2003 2004; do
+for y in 2003 2004 2005; do
     for i in . lfs alfs blfs hlfs hints; do
-        # "LC_ALL=C" garantees a sane localization setting
-        LC_ALL=C $MANAGE_NEWS -a news/ -t $TEMPLATES/$i/archive-top.html -b $TEMPLATES/$i/archive-bottom.html -i $i/news-$y.txt
+		if [ -e "$i/news-$y.txt" ]; then
+			# "LC_ALL=C" garantees a sane localization setting
+        	LC_ALL=C $MANAGE_NEWS -a news/ -t $TEMPLATES/$i/archive-top.html -b $TEMPLATES/$i/archive-bottom.html -i $i/news-$y.txt
+		fi
     done
 done
 
@@ -118,6 +120,7 @@
 $SCRIPTS/lfs2rss.pl -n news.html -r feed.rss
 cd $NEWSITE/hlfs
 $SCRIPTS/lfs2rss.pl -n news.html -r feed.rss
+
 ##########################################
 # Create mirrors list for each section   #
 




More information about the website mailing list