cvs commit: www manage_news.pl

lizardo at linuxfromscratch.org lizardo at linuxfromscratch.org
Thu Nov 13 18:53:35 PST 2003


lizardo     03/11/13 19:53:35

  Modified:    .        manage_news.pl
  Log:
  manage_news.pl: Removed "read from STDIN" support, it does not work currently.
  
  Revision  Changes    Path
  1.20      +11 -13    www/manage_news.pl
  
  Index: manage_news.pl
  ===================================================================
  RCS file: /home/cvsroot/www/manage_news.pl,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- manage_news.pl	14 Nov 2003 01:44:53 -0000	1.19
  +++ manage_news.pl	14 Nov 2003 02:53:35 -0000	1.20
  @@ -17,10 +17,10 @@
   # along with this program; if not, write to the Free Software
   # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
   
  -# $Id: manage_news.pl,v 1.19 2003/11/14 01:44:53 lizardo Exp $
  +# $Id: manage_news.pl,v 1.20 2003/11/14 02:53:35 lizardo Exp $
   
  -use warnings;
   use strict;
  +use warnings;
   
   use File::Path qw(mkpath);
   use POSIX qw(strftime);
  @@ -51,7 +51,9 @@
   pod2usage(-exitstatus => 0, -verbose => 2) if $man;
   
   my $parser = new MIME::Parser;
  -# These options disable the use of temporary files
  +
  +# These options disable the use of temporary files and use "in-core"
  +# (memory-only) structures instead.
   $parser->output_to_core(1);
   $parser->tmp_to_core(1);
   $parser->use_inner_files(1);
  @@ -62,16 +64,14 @@
   my $mime_entity;
   my $input_name;
   
  -# Read the input file if one is given; otherwise, read from STDIN
  +# Read input file, given with -i option
   if ($infile) {
       $input_name = $ENV{"PWD"} . "/" . $infile;
  -    check_syntax($infile);
  +    check_syntax();
       eval { $mime_entity = $parser->parse_open($infile) } or pod2usage("$0\: $@");
   }
   else {
  -    $input_name = "<STDIN>";
  -    check_syntax(\*STDIN);
  -    $mime_entity = $parser->parse(\*STDIN);
  +    pod2usage("$0\: You need to specify a filename with -i option");
   }
   
   my $lfs_url = "/";
  @@ -290,7 +290,6 @@
   
   # Validate MIME database for syntax
   sub check_syntax {
  -    my ($filename) = @_;
   
       my %tests = ();
       my $cur_line = 0;
  @@ -298,7 +297,7 @@
       # Boundary line number of current item
       my $cur_item = 0;
   
  -    open(FILE, $filename);
  +    open(FILE, $infile);
       while (<FILE>) {
           $cur_line++;
           if (/^(\s*)Content-Type:\s+multipart\/mixed;/i) {
  @@ -377,7 +376,7 @@
   
   =head1 SYNOPSIS
   
  -manage_news.pl  [--help|--man]  [-t top.html]  [-b bottom.html]  [-a output_dir] [-i html_file]
  +manage_news.pl  [--help|--man]  [-t top.html]  [-b bottom.html]  [-a output_dir] -i mime_db
   
       Options:
           --infile|-i         Parse MIME news database from given file
  @@ -399,8 +398,7 @@
   
   =item B<--infile mime_db>
   
  -Specify a MIME news database to parse. By default, B<manage_news.pl> reads
  -the MIME database from standard input.
  +Specify a MIME news database to parse.
   
   =item B<--top top.html, --bottom bottom.html>
   
  
  
  



More information about the website mailing list