uh_parser/uh.pl
changeset 249 f0ed429f31b7
parent 228 ba90e30c0f3c
child 252 f593b7acdb37
equal deleted inserted replaced
247:b836184892c6 249:f0ed429f31b7
    41 	'basedir=s' => \$basedir,
    41 	'basedir=s' => \$basedir,
    42 	'help!' => \$help
    42 	'help!' => \$help
    43 ));
    43 ));
    44 my @logfiles = @ARGV;
    44 my @logfiles = @ARGV;
    45 
    45 
    46 $help = 1 if (!@logfiles);
       
    47 
       
    48 if ($help)
    46 if ($help)
    49 {
    47 {
    50 	print "Unite and HTML-ize Raptor log files.\n";
    48 	print "Unite and HTML-ize Raptor log files.\n";
    51 	print "Usage: perl uh.pl [OPTIONS] FILE1 FILE2 ...\n";
    49 	print "Usage: perl uh.pl [OPTIONS] FILE1 FILE2 ...\n";
    52 	print "where OPTIONS are:\n";
    50 	print "where FILE1 FILE2 ... are Raptor log files.\n";
       
    51 	print "If no file argument is provided then UH takes the latest under \\epoc32\\build\n";
       
    52 	print "OPTIONS:\n";
    53 	print "\t-m, --missing\tAlso add the list of missing binaries (Raptor log should include whatlog info).\n";
    53 	print "\t-m, --missing\tAlso add the list of missing binaries (Raptor log should include whatlog info).\n";
    54 	print "\t\t\tCheck is done against the epoc tree at the root of the current drive\n";
    54 	print "\t\t\tCheck is done against the epoc tree at the root of the current drive\n";
    55 	print "\t-b DIR, --basedir DIR\tGenerate output under DIR (defaults to current dir)\n";
    55 	print "\t-b DIR, --basedir DIR\tGenerate output under DIR (defaults to current dir)\n";
       
    56 	exit(0);
       
    57 }
       
    58 
       
    59 if (!@logfiles)
       
    60 {
       
    61 	if (-d "\\epoc32\\build")
       
    62 	{
       
    63 		opendir(BUILDDIR, "\\epoc32\\build");
       
    64 		my @allfoundlogfiles = grep(/^Makefile.\d{4}-\d{2}-\d{2}-\d{2}-\d{2}-\d{2}\.log$/, readdir(BUILDDIR));
       
    65 		@allfoundlogfiles = sort {$b cmp $a} @allfoundlogfiles;
       
    66 		push @logfiles, "\\epoc32\\build\\" . shift @allfoundlogfiles;
       
    67 	}
       
    68 }
       
    69 
       
    70 if (!@logfiles)
       
    71 {
       
    72 	print "No files to parse.\n";
    56 	exit(0);
    73 	exit(0);
    57 }
    74 }
    58 
    75 
    59 if ($basedir)
    76 if ($basedir)
    60 {
    77 {