Make UH parse the latest file under \epoc32\build by default
authorDario Sestito <darios@symbian.org>
Fri, 30 Apr 2010 12:18:51 +0100
changeset 249 f0ed429f31b7
parent 247 b836184892c6
child 250 4942b4c09f29
Make UH parse the latest file under \epoc32\build by default
uh_parser/uh.pl
--- a/uh_parser/uh.pl	Wed Apr 28 11:10:24 2010 +0100
+++ b/uh_parser/uh.pl	Fri Apr 30 12:18:51 2010 +0100
@@ -43,19 +43,36 @@
 ));
 my @logfiles = @ARGV;
 
-$help = 1 if (!@logfiles);
-
 if ($help)
 {
 	print "Unite and HTML-ize Raptor log files.\n";
 	print "Usage: perl uh.pl [OPTIONS] FILE1 FILE2 ...\n";
-	print "where OPTIONS are:\n";
+	print "where FILE1 FILE2 ... are Raptor log files.\n";
+	print "If no file argument is provided then UH takes the latest under \\epoc32\\build\n";
+	print "OPTIONS:\n";
 	print "\t-m, --missing\tAlso add the list of missing binaries (Raptor log should include whatlog info).\n";
 	print "\t\t\tCheck is done against the epoc tree at the root of the current drive\n";
 	print "\t-b DIR, --basedir DIR\tGenerate output under DIR (defaults to current dir)\n";
 	exit(0);
 }
 
+if (!@logfiles)
+{
+	if (-d "\\epoc32\\build")
+	{
+		opendir(BUILDDIR, "\\epoc32\\build");
+		my @allfoundlogfiles = grep(/^Makefile.\d{4}-\d{2}-\d{2}-\d{2}-\d{2}-\d{2}\.log$/, readdir(BUILDDIR));
+		@allfoundlogfiles = sort {$b cmp $a} @allfoundlogfiles;
+		push @logfiles, "\\epoc32\\build\\" . shift @allfoundlogfiles;
+	}
+}
+
+if (!@logfiles)
+{
+	print "No files to parse.\n";
+	exit(0);
+}
+
 if ($basedir)
 {
 	$raptorbitsdir = "$basedir/raptorbits";