# HG changeset patch # User victorp@symbian.org # Date 1262620855 0 # Node ID 48be12a54405e9286415a75e316f6cb902e46a5f # Parent 9f3ba8091f46c02e0c39f34f13c4bf837c16b010 update to gettd.pl including a count option see -h for more info diff -r 9f3ba8091f46 -r 48be12a54405 scripts/gettd.pl --- a/scripts/gettd.pl Mon Dec 21 12:33:47 2009 +0000 +++ b/scripts/gettd.pl Mon Jan 04 16:00:55 2010 +0000 @@ -12,7 +12,7 @@ my $authon= ''; #does it require authorisation? default is false - +my $count_target; #this value is used to pass a string to match and count on each package backlog my $ispackage; my $splitbklogs; my $summaryheader="ID\tPackage\tFeatures\tFormat\tHttp\n" ; @@ -257,6 +257,7 @@ $mypkg=loadfile $infile; #list if the bklog has been ported to the new bugzilla based format $headerformat= "wiki_format"; + open ( outputfile, ">>".$outfile); open ( soutputfile, ">>"."summary_".$outfile); @@ -282,6 +283,8 @@ } print "INFO -Processing Package $pagename \n"; $i=0; + $found_counter =0; + if ($mypkg =~m/class\=\"bugzilla sortable\"/sg ) { $headerformat="autobug_format"; } while ($mypkg =~ m/\(.*?)\<\/tr/sg) { @@ -303,16 +306,23 @@ print outputfile "$pagename\t$myfeat\n"; if ($splitbklogs) { print tdoutputfile "$pagename\t$myfeat\n";} + # print "matching $myfeat with $count_target\n" ; + if ($myfeat =~ m/$count_target/sg) {$found_counter++;} $i++; } } - + + if ($count_target){ + $mycount=$i."\t".$found_counter; + } else { + $mycount=$i; + } if ($splitbklogs) { - print soutputfile "$id\t$pagename\t$i\t$headerformat\t$whichtd\thttp://developer.symbian.org/wiki/index.php/$pagename\n"; + print soutputfile "$id\t$pagename\t$mycount\t$headerformat\t$whichtd\thttp://developer.symbian.org/wiki/index.php/$pagename\n"; } else { - print soutputfile "$id\t$pagename\t$i\t$headerformat\thttp://developer.symbian.org/wiki/index.php/$pagename\n"; + print soutputfile "$id\t$pagename\t$mycount\t$headerformat\thttp://developer.symbian.org/wiki/index.php/$pagename\n"; } } @@ -336,6 +346,7 @@ \n\nRequired Parameters for Package backlogs\n\t-p for package backlog analysis. just run gettd.pl -p \n\nOptional Pararmeters for Package backlogs\n\t -compare [f1] [f2] compares two package summary files for changes ignores order \n\t -split splits the content of the backlog output into technology domains. requires package_domains.csv file with mapping details + \n\t -count=regexp counts the times that a package backlog line matches the regexp, the results are output to the summary file \n\nCommonOptional parameters\n\t-o filename ,the output is logged into the output.csv file by default\n\t-h for help \n\t recommend to run under cygwin environment and perl version v5.10.0 \n \n\t pages blacklisted for package backlogs are @blist\n"; @@ -379,12 +390,15 @@ GetOptions('h' => \$help,'t=s'=> \$target_url, 'd=s' => \$tdomain , 'o=s' => \$csvfile, 'a' => \$authon , 'p' => \$ispackage, 'compare=s{2}' =>\@compare, 'new' => \$isnewformat, - 'split' => \$splitbklogs); + 'split' => \$splitbklogs, 'count=s' => \$count_target); if (@compare) { compare_bklogs @compare; } + if ($count_target) { + print "INFO - Seaching for $count_target\n"; + } if ($help) { printhelp;