tdroadmap_merger/gettd.pl
author Simon Howkins <simonh@symbian.org>
Mon, 09 Nov 2009 14:27:03 +0000
changeset 104 1350a673dd5f
parent 68 6a685c67fb1f
permissions -rw-r--r--
Alternative script for generating release note information about package changes and FCL usage. Uses the sources.csv and sysdef, so doesn't need to access the release archive to access previous package lists or names, and can work concurrently with other build analysis steps.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
27
7dccd04e54f9 gettd.pl v0.5, support for bklog compare and fix feature count
victorp@symbian.org
parents: 26
diff changeset
     1
#!/usr/bin/perl
7dccd04e54f9 gettd.pl v0.5, support for bklog compare and fix feature count
victorp@symbian.org
parents: 26
diff changeset
     2
22
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
     3
 
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
     4
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
     5
use IO::Socket; 
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
     6
use Getopt::Long;
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
     7
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
     8
23
8fb98cf0b1ac remove authentication as default, added -a option for cookies
victorp@symbian.org
parents: 22
diff changeset
     9
my $target_url; #target url for the roadmap
8fb98cf0b1ac remove authentication as default, added -a option for cookies
victorp@symbian.org
parents: 22
diff changeset
    10
my $tdomain; #tag for the domain to be use in csv file
8fb98cf0b1ac remove authentication as default, added -a option for cookies
victorp@symbian.org
parents: 22
diff changeset
    11
my $csvfile; #output csv file name
24
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 23
diff changeset
    12
my $authon= '';	 #does it require authorisation? default is false
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 23
diff changeset
    13
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 23
diff changeset
    14
my $ispackage;
31
d1d21a2aeabc gettd.pl version 0.5 support for format analysis and bash file executable
victorp@symbian.org
parents: 27
diff changeset
    15
my $summaryheader="ID\tPackage\tFeatures\tFormat\tHttp\n" ;
67
4ed9a3a59ef8 gettd.p version 0.6
victorp@symbian.org
parents: 32
diff changeset
    16
my $newtdformat = 0;
27
7dccd04e54f9 gettd.pl v0.5, support for bklog compare and fix feature count
victorp@symbian.org
parents: 26
diff changeset
    17
22
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
    18
sub getpage
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
    19
{
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
    20
	#arguments
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
    21
	($page,$host,$auth,$myfile)=@_;
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
    22
	
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
    23
	
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
    24
	#output file
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
    25
	open ( outputfile, ">".$myfile);
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
    26
	
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
    27
	
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
    28
	$port = "http(80)";
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
    29
	$getmess = "GET " . $page ." HTTP/1.1\n" . $auth;
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
    30
23
8fb98cf0b1ac remove authentication as default, added -a option for cookies
victorp@symbian.org
parents: 22
diff changeset
    31
	print "INFO - sending message - $getmess\n";
22
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
    32
	print outputfile "$getmess\n\n";
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
    33
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
    34
	$sock = IO::Socket::INET->new 	
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
    35
		(
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
    36
		 PeerAddr => $host,   PeerPort => $port,  Proto => 'tcp', 
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
    37
		) ;
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
    38
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
    39
 
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
    40
	print $sock "$getmess\n\n";
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
    41
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
    42
 
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
    43
	while(<$sock>) {
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
    44
 
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
    45
	  print outputfile $_;
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
    46
 
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
    47
	}	
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
    48
  	
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
    49
	close ($sock);
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
    50
	close (outputfile);
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
    51
}
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
    52
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
    53
sub prntfeatures 
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
    54
{
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
    55
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
    56
	($release,$package,$features,$myfile,$domain)=@_;
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
    57
	
67
4ed9a3a59ef8 gettd.p version 0.6
victorp@symbian.org
parents: 32
diff changeset
    58
  $release =~ s/\\//sg;	
4ed9a3a59ef8 gettd.p version 0.6
victorp@symbian.org
parents: 32
diff changeset
    59
	
4ed9a3a59ef8 gettd.p version 0.6
victorp@symbian.org
parents: 32
diff changeset
    60
 if ($newtdformat) {
4ed9a3a59ef8 gettd.p version 0.6
victorp@symbian.org
parents: 32
diff changeset
    61
  $package =~ s/backlog//sgi;
4ed9a3a59ef8 gettd.p version 0.6
victorp@symbian.org
parents: 32
diff changeset
    62
  print $myfile " $release, $domain, $package, $myfeat\n";
4ed9a3a59ef8 gettd.p version 0.6
victorp@symbian.org
parents: 32
diff changeset
    63
  
4ed9a3a59ef8 gettd.p version 0.6
victorp@symbian.org
parents: 32
diff changeset
    64
 } else {
4ed9a3a59ef8 gettd.p version 0.6
victorp@symbian.org
parents: 32
diff changeset
    65
		
22
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
    66
	$features = $features."<dt";
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
    67
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
    68
	
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
    69
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
    70
	while ( $features =~ /dt\>(.*?)\<\/dt(.*?)\<dt/sg  ){
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
    71
		$myfeat = $1;
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
    72
		$subfeat =$2;
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
    73
		
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
    74
		$myfeat =~ s/\n/ /sg;
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
    75
		
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
    76
		pos($features) = pos($features) -2;
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
    77
		
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
    78
		$mystr="";
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
    79
		while ( $subfeat =~ /\<dd\>(.*?)\<\/dd\>/sg) {
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
    80
			$mysubfeat = $mysubfeat.$mystr.$1;
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
    81
			$mystr = " & ";
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
    82
		}
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
    83
		undef $mystr;
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
    84
	$mysubfeat =~ s/,/ /sg;
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
    85
	$mysubfeat =~ s/\n//sg;
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
    86
	$mysubfeat =~ s/\<.*?\>//sg;
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
    87
	
67
4ed9a3a59ef8 gettd.p version 0.6
victorp@symbian.org
parents: 32
diff changeset
    88
22
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
    89
	print $myfile " $release, $domain, $package, $myfeat, $mysubfeat\n";
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
    90
	
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
    91
	$mysubfeat = "";	
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
    92
	}
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
    93
		
67
4ed9a3a59ef8 gettd.p version 0.6
victorp@symbian.org
parents: 32
diff changeset
    94
 }
22
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
    95
}
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
    96
	
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
    97
sub loadfile
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
    98
{
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
    99
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   100
	$/ = " ";
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   101
	#arguments
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   102
	($myfile)=@_;
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   103
	open ( inputfile, "<".$myfile);
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   104
	my $contents = do { local $/;  <inputfile> };
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   105
	close(inputfile);
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   106
	return $contents;
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   107
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   108
}
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   109
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   110
sub td_roadmap
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   111
{
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   112
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   113
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   114
	#arguments
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   115
	($infile,$outfile,$domain,@releases)=@_;
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   116
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   117
	
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   118
	$roadmap=loadfile $infile;
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   119
	open ( outputfile, ">>".$outfile);
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   120
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   121
67
4ed9a3a59ef8 gettd.p version 0.6
victorp@symbian.org
parents: 32
diff changeset
   122
  if ($newtdformat) {
4ed9a3a59ef8 gettd.p version 0.6
victorp@symbian.org
parents: 32
diff changeset
   123
       print "Processing new TD roadmap format\n";
4ed9a3a59ef8 gettd.p version 0.6
victorp@symbian.org
parents: 32
diff changeset
   124
         if ($roadmap =~ m /Contents\<\/h2\>.*?\<\/table/sg) { $roadmap =$';}
4ed9a3a59ef8 gettd.p version 0.6
victorp@symbian.org
parents: 32
diff changeset
   125
         foreach (@releases) {
4ed9a3a59ef8 gettd.p version 0.6
victorp@symbian.org
parents: 32
diff changeset
   126
          $exp=$_." Roadmap";
4ed9a3a59ef8 gettd.p version 0.6
victorp@symbian.org
parents: 32
diff changeset
   127
		         
4ed9a3a59ef8 gettd.p version 0.6
victorp@symbian.org
parents: 32
diff changeset
   128
           if ($roadmap =~ m /($exp)/sg) { 
4ed9a3a59ef8 gettd.p version 0.6
victorp@symbian.org
parents: 32
diff changeset
   129
			     print "PASS - Found entry for $_ \n";
4ed9a3a59ef8 gettd.p version 0.6
victorp@symbian.org
parents: 32
diff changeset
   130
			     $relroad =$';	
4ed9a3a59ef8 gettd.p version 0.6
victorp@symbian.org
parents: 32
diff changeset
   131
			
4ed9a3a59ef8 gettd.p version 0.6
victorp@symbian.org
parents: 32
diff changeset
   132
			     if ($roadmap =~ m /table\>(.*?)\<\/table/sg) { $relroad =$1;}
4ed9a3a59ef8 gettd.p version 0.6
victorp@symbian.org
parents: 32
diff changeset
   133
			           
4ed9a3a59ef8 gettd.p version 0.6
victorp@symbian.org
parents: 32
diff changeset
   134
           while ($relroad =~ m/title\=\"(.*?)\"\>(.*)/g) {
4ed9a3a59ef8 gettd.p version 0.6
victorp@symbian.org
parents: 32
diff changeset
   135
                 $package=$1;
4ed9a3a59ef8 gettd.p version 0.6
victorp@symbian.org
parents: 32
diff changeset
   136
                 $myfeat=$2;
4ed9a3a59ef8 gettd.p version 0.6
victorp@symbian.org
parents: 32
diff changeset
   137
                 $myfeat=~ s/\<\/td\>\<td\>/-/sg;   #TODO change - to , when the old format is dead
4ed9a3a59ef8 gettd.p version 0.6
victorp@symbian.org
parents: 32
diff changeset
   138
                 $myfeat=~ s/\<.*?\>//sg;
4ed9a3a59ef8 gettd.p version 0.6
victorp@symbian.org
parents: 32
diff changeset
   139
                 prntfeatures($_,$package,$myfeat,outputfile,$domain);
4ed9a3a59ef8 gettd.p version 0.6
victorp@symbian.org
parents: 32
diff changeset
   140
                
4ed9a3a59ef8 gettd.p version 0.6
victorp@symbian.org
parents: 32
diff changeset
   141
                 }  		     
4ed9a3a59ef8 gettd.p version 0.6
victorp@symbian.org
parents: 32
diff changeset
   142
         }
4ed9a3a59ef8 gettd.p version 0.6
victorp@symbian.org
parents: 32
diff changeset
   143
        }
4ed9a3a59ef8 gettd.p version 0.6
victorp@symbian.org
parents: 32
diff changeset
   144
  } else {
22
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   145
67
4ed9a3a59ef8 gettd.p version 0.6
victorp@symbian.org
parents: 32
diff changeset
   146
	 foreach (@releases) {
22
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   147
		
67
4ed9a3a59ef8 gettd.p version 0.6
victorp@symbian.org
parents: 32
diff changeset
   148
	 	$exp="\\<h2\\>.*?\\>".$_;
4ed9a3a59ef8 gettd.p version 0.6
victorp@symbian.org
parents: 32
diff changeset
   149
		  
22
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   150
		if ($roadmap =~ m /($exp)/sg) { 
23
8fb98cf0b1ac remove authentication as default, added -a option for cookies
victorp@symbian.org
parents: 22
diff changeset
   151
			print "PASS - Found entry for $_ \n";
22
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   152
			$relroad =$';	
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   153
			
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   154
			if ($relroad =~ m /(.*?)\<h2/sg) { $relroad =$1;}
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   155
			$i=0;	
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   156
			while ($relroad=~ m/\<h3\>.*\>(.*?)\<.*<\/h3/g) {
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   157
				$package = $1;		
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   158
				$ppos[$i]= pos($relroad);
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   159
				$pname[$i]= $package;
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   160
				$i++;
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   161
			}
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   162
			for ( $i=0;$i<($#ppos); $i++){
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   163
				$features= substr ($relroad, $ppos[$i],$ppos[$i+1]-$ppos[$i]);
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   164
				prntfeatures($_,$pname[$i],$features,outputfile,$domain);
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   165
			}
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   166
			$features= substr ($relroad, $ppos[$i]);
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   167
		
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   168
			prntfeatures($_,$pname[$i],$features,outputfile,$domain);
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   169
			@ppos ="";
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   170
			@pname ="";
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   171
			undef ($features);
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   172
		}
67
4ed9a3a59ef8 gettd.p version 0.6
victorp@symbian.org
parents: 32
diff changeset
   173
	}		 	
22
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   174
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   175
	}
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   176
	
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   177
	
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   178
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   179
	close (outputfile);
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   180
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   181
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   182
}
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   183
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   184
24
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 23
diff changeset
   185
sub parse_category {
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 23
diff changeset
   186
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 23
diff changeset
   187
	#arguments
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 23
diff changeset
   188
	($infile)=@_;
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 23
diff changeset
   189
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 23
diff changeset
   190
	my @mylink;
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 23
diff changeset
   191
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 23
diff changeset
   192
	$mypage=loadfile $infile;
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 23
diff changeset
   193
	$i=0;	
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 23
diff changeset
   194
	if ( $mypage =~ m/Pages in category(.*)\<\/table/sg) {
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 23
diff changeset
   195
		print "INFO - Category page found\n";
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 23
diff changeset
   196
		$mypage = $1;
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 23
diff changeset
   197
		while ($mypage =~ m /\<a href\=\"(\/wiki\/index\.php\/.*?)\"/g) {
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 23
diff changeset
   198
			
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 23
diff changeset
   199
			$mylink[$i] = $1;	
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 23
diff changeset
   200
			$i++;
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 23
diff changeset
   201
			
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 23
diff changeset
   202
		}
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 23
diff changeset
   203
	print "INFO - Found $i items in the category page\n"
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 23
diff changeset
   204
	}
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 23
diff changeset
   205
	return @mylink;
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 23
diff changeset
   206
}
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 23
diff changeset
   207
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 23
diff changeset
   208
sub parse_bklog {
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 23
diff changeset
   209
	
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 23
diff changeset
   210
	#arguments
27
7dccd04e54f9 gettd.pl v0.5, support for bklog compare and fix feature count
victorp@symbian.org
parents: 26
diff changeset
   211
	($infile,$outfile,$id)=@_;
24
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 23
diff changeset
   212
	$mypkg=loadfile $infile;
31
d1d21a2aeabc gettd.pl version 0.5 support for format analysis and bash file executable
victorp@symbian.org
parents: 27
diff changeset
   213
	#list if the bklog has been ported to the new bugzilla based format
d1d21a2aeabc gettd.pl version 0.5 support for format analysis and bash file executable
victorp@symbian.org
parents: 27
diff changeset
   214
  $headerformat= "wiki_format";
d1d21a2aeabc gettd.pl version 0.5 support for format analysis and bash file executable
victorp@symbian.org
parents: 27
diff changeset
   215
	
24
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 23
diff changeset
   216
	open ( outputfile, ">>".$outfile);
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 23
diff changeset
   217
	open ( soutputfile, ">>"."summary_".$outfile);
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 23
diff changeset
   218
	
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 23
diff changeset
   219
	if ($mypkg =~ m/index\.php\/(.*?) HTTP/sg) {
27
7dccd04e54f9 gettd.pl v0.5, support for bklog compare and fix feature count
victorp@symbian.org
parents: 26
diff changeset
   220
  
24
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 23
diff changeset
   221
		$pagename = $1;
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 23
diff changeset
   222
		print "INFO -Processing Package $pagename \n";
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 23
diff changeset
   223
		$i=0;
68
6a685c67fb1f gettd.pl version 0.6a
victorp@symbian.org
parents: 67
diff changeset
   224
		if ($mypkg =~m/class\=\"bugzilla sortable\"/sg ) { $headerformat="autobug_format"; }
27
7dccd04e54f9 gettd.pl v0.5, support for bklog compare and fix feature count
victorp@symbian.org
parents: 26
diff changeset
   225
		
68
6a685c67fb1f gettd.pl version 0.6a
victorp@symbian.org
parents: 67
diff changeset
   226
		while ($mypkg =~ m/\<tr.*?\>(.*?)\<\/tr/sg) { 
31
d1d21a2aeabc gettd.pl version 0.5 support for format analysis and bash file executable
victorp@symbian.org
parents: 27
diff changeset
   227
			$myheader= $&;
d1d21a2aeabc gettd.pl version 0.5 support for format analysis and bash file executable
victorp@symbian.org
parents: 27
diff changeset
   228
      if ($myheader =~ m/style=\"background-color\:/sg) {
d1d21a2aeabc gettd.pl version 0.5 support for format analysis and bash file executable
victorp@symbian.org
parents: 27
diff changeset
   229
        if ($myheader =~ m/Bug ID/sg) { $headerformat="bugzilla_format";}
d1d21a2aeabc gettd.pl version 0.5 support for format analysis and bash file executable
victorp@symbian.org
parents: 27
diff changeset
   230
        next;
d1d21a2aeabc gettd.pl version 0.5 support for format analysis and bash file executable
victorp@symbian.org
parents: 27
diff changeset
   231
      }
24
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 23
diff changeset
   232
			$myfeat= $1;
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 23
diff changeset
   233
			$myfeat =~ s/\<\/td\>/\t/sg;
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 23
diff changeset
   234
			$myfeat =~ s/\<.*?\>//sg;
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 23
diff changeset
   235
			$myfeat =~ s/\n//sg;
26
cad9fdd53748 gettd.pl v0.04 - fix to delete empty lines
victorp@symbian.org
parents: 25
diff changeset
   236
			
27
7dccd04e54f9 gettd.pl v0.5, support for bklog compare and fix feature count
victorp@symbian.org
parents: 26
diff changeset
   237
			
7dccd04e54f9 gettd.pl v0.5, support for bklog compare and fix feature count
victorp@symbian.org
parents: 26
diff changeset
   238
			if ($myfeat =~ m/[A-z]/sg and not $myfeat =~ m/\&lt\;etc/sg and 
7dccd04e54f9 gettd.pl v0.5, support for bklog compare and fix feature count
victorp@symbian.org
parents: 26
diff changeset
   239
			not $myfeat =~ m/\&lt\;Feature/sg and not $myfeat =~ m/Item not available/sg) {
26
cad9fdd53748 gettd.pl v0.04 - fix to delete empty lines
victorp@symbian.org
parents: 25
diff changeset
   240
				print outputfile "$pagename\t$myfeat\n";
cad9fdd53748 gettd.pl v0.04 - fix to delete empty lines
victorp@symbian.org
parents: 25
diff changeset
   241
				$i++;
cad9fdd53748 gettd.pl v0.04 - fix to delete empty lines
victorp@symbian.org
parents: 25
diff changeset
   242
			}
24
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 23
diff changeset
   243
			
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 23
diff changeset
   244
		}
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 23
diff changeset
   245
31
d1d21a2aeabc gettd.pl version 0.5 support for format analysis and bash file executable
victorp@symbian.org
parents: 27
diff changeset
   246
	print soutputfile "$id\t$pagename\t$i\t$headerformat\thttp://developer.symbian.org/wiki/index.php/$pagename\n";
24
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 23
diff changeset
   247
	
27
7dccd04e54f9 gettd.pl v0.5, support for bklog compare and fix feature count
victorp@symbian.org
parents: 26
diff changeset
   248
24
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 23
diff changeset
   249
	}
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 23
diff changeset
   250
27
7dccd04e54f9 gettd.pl v0.5, support for bklog compare and fix feature count
victorp@symbian.org
parents: 26
diff changeset
   251
	close (outputfile);
7dccd04e54f9 gettd.pl v0.5, support for bklog compare and fix feature count
victorp@symbian.org
parents: 26
diff changeset
   252
	close (soutputfile);
7dccd04e54f9 gettd.pl v0.5, support for bklog compare and fix feature count
victorp@symbian.org
parents: 26
diff changeset
   253
7dccd04e54f9 gettd.pl v0.5, support for bklog compare and fix feature count
victorp@symbian.org
parents: 26
diff changeset
   254
7dccd04e54f9 gettd.pl v0.5, support for bklog compare and fix feature count
victorp@symbian.org
parents: 26
diff changeset
   255
}
7dccd04e54f9 gettd.pl v0.5, support for bklog compare and fix feature count
victorp@symbian.org
parents: 26
diff changeset
   256
24
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 23
diff changeset
   257
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 23
diff changeset
   258
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 23
diff changeset
   259
22
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   260
#help print
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   261
sub printhelp
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   262
{
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   263
67
4ed9a3a59ef8 gettd.p version 0.6
victorp@symbian.org
parents: 32
diff changeset
   264
	print "\n\n version 0.6
4ed9a3a59ef8 gettd.p version 0.6
victorp@symbian.org
parents: 32
diff changeset
   265
	\ngettd.pl -t=url -d=domain \n\nRequired parameters for Technology Roadmaps:\n\t -t url containing the technology domain roadmap\n\t -d the technology domain name
4ed9a3a59ef8 gettd.p version 0.6
victorp@symbian.org
parents: 32
diff changeset
   266
	\n\nOptional Parmeters for Technology Roadmaps\n\t-new if the roadmap has the new wiki format
4ed9a3a59ef8 gettd.p version 0.6
victorp@symbian.org
parents: 32
diff changeset
   267
  \n\nRequired Parameters for Package backlogs\n\t-p for package backlog analysis. just run gettd.pl -p
4ed9a3a59ef8 gettd.p version 0.6
victorp@symbian.org
parents: 32
diff changeset
   268
  \n\nOptional Pararmeters for Package backlogs\n\t -compare [f1] [f2] compares two package summary files for changes ignores order
4ed9a3a59ef8 gettd.p version 0.6
victorp@symbian.org
parents: 32
diff changeset
   269
  \n\nCommonOptional parameters\n\t-o filename ,the output is logged into the output.csv file by default\n\t-h for help
4ed9a3a59ef8 gettd.p version 0.6
victorp@symbian.org
parents: 32
diff changeset
   270
	\n\t recommend to run under cygwin environment and perl version v5.10.0 \n";
22
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   271
	exit;
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   272
}
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   273
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   274
27
7dccd04e54f9 gettd.pl v0.5, support for bklog compare and fix feature count
victorp@symbian.org
parents: 26
diff changeset
   275
7dccd04e54f9 gettd.pl v0.5, support for bklog compare and fix feature count
victorp@symbian.org
parents: 26
diff changeset
   276
#compare bklogs
7dccd04e54f9 gettd.pl v0.5, support for bklog compare and fix feature count
victorp@symbian.org
parents: 26
diff changeset
   277
sub compare_bklogs {
7dccd04e54f9 gettd.pl v0.5, support for bklog compare and fix feature count
victorp@symbian.org
parents: 26
diff changeset
   278
	#arguments
7dccd04e54f9 gettd.pl v0.5, support for bklog compare and fix feature count
victorp@symbian.org
parents: 26
diff changeset
   279
	(@bklogs)=@_;
7dccd04e54f9 gettd.pl v0.5, support for bklog compare and fix feature count
victorp@symbian.org
parents: 26
diff changeset
   280
	
7dccd04e54f9 gettd.pl v0.5, support for bklog compare and fix feature count
victorp@symbian.org
parents: 26
diff changeset
   281
	if (not $#bklogs == 1) { printhelp;}
7dccd04e54f9 gettd.pl v0.5, support for bklog compare and fix feature count
victorp@symbian.org
parents: 26
diff changeset
   282
7dccd04e54f9 gettd.pl v0.5, support for bklog compare and fix feature count
victorp@symbian.org
parents: 26
diff changeset
   283
	
7dccd04e54f9 gettd.pl v0.5, support for bklog compare and fix feature count
victorp@symbian.org
parents: 26
diff changeset
   284
	$cmd ="cut -f 2,3 ". $bklogs[0] . " | sort -u > tmp1.txt";
7dccd04e54f9 gettd.pl v0.5, support for bklog compare and fix feature count
victorp@symbian.org
parents: 26
diff changeset
   285
	
7dccd04e54f9 gettd.pl v0.5, support for bklog compare and fix feature count
victorp@symbian.org
parents: 26
diff changeset
   286
	system($cmd);
7dccd04e54f9 gettd.pl v0.5, support for bklog compare and fix feature count
victorp@symbian.org
parents: 26
diff changeset
   287
	
7dccd04e54f9 gettd.pl v0.5, support for bklog compare and fix feature count
victorp@symbian.org
parents: 26
diff changeset
   288
	$cmd ="cut -f 2,3 ". $bklogs[1] . " | sort -u > tmp2.txt";
7dccd04e54f9 gettd.pl v0.5, support for bklog compare and fix feature count
victorp@symbian.org
parents: 26
diff changeset
   289
	system($cmd);
7dccd04e54f9 gettd.pl v0.5, support for bklog compare and fix feature count
victorp@symbian.org
parents: 26
diff changeset
   290
	
7dccd04e54f9 gettd.pl v0.5, support for bklog compare and fix feature count
victorp@symbian.org
parents: 26
diff changeset
   291
	exec ("diff tmp1.txt tmp2.txt | grep '[<|>]'");
7dccd04e54f9 gettd.pl v0.5, support for bklog compare and fix feature count
victorp@symbian.org
parents: 26
diff changeset
   292
	system("rm temp*.txt");
7dccd04e54f9 gettd.pl v0.5, support for bklog compare and fix feature count
victorp@symbian.org
parents: 26
diff changeset
   293
	
7dccd04e54f9 gettd.pl v0.5, support for bklog compare and fix feature count
victorp@symbian.org
parents: 26
diff changeset
   294
	exit;
7dccd04e54f9 gettd.pl v0.5, support for bklog compare and fix feature count
victorp@symbian.org
parents: 26
diff changeset
   295
7dccd04e54f9 gettd.pl v0.5, support for bklog compare and fix feature count
victorp@symbian.org
parents: 26
diff changeset
   296
}
7dccd04e54f9 gettd.pl v0.5, support for bklog compare and fix feature count
victorp@symbian.org
parents: 26
diff changeset
   297
7dccd04e54f9 gettd.pl v0.5, support for bklog compare and fix feature count
victorp@symbian.org
parents: 26
diff changeset
   298
7dccd04e54f9 gettd.pl v0.5, support for bklog compare and fix feature count
victorp@symbian.org
parents: 26
diff changeset
   299
7dccd04e54f9 gettd.pl v0.5, support for bklog compare and fix feature count
victorp@symbian.org
parents: 26
diff changeset
   300
22
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   301
#process command line options
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   302
sub cmd_options
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   303
{
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   304
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   305
  my $help;
27
7dccd04e54f9 gettd.pl v0.5, support for bklog compare and fix feature count
victorp@symbian.org
parents: 26
diff changeset
   306
  my @compare;
22
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   307
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   308
27
7dccd04e54f9 gettd.pl v0.5, support for bklog compare and fix feature count
victorp@symbian.org
parents: 26
diff changeset
   309
  GetOptions('h' => \$help,'t=s'=> \$target_url, 'd=s' => \$tdomain , 'o=s' => \$csvfile, 
67
4ed9a3a59ef8 gettd.p version 0.6
victorp@symbian.org
parents: 32
diff changeset
   310
	'a' => \$authon , 'p' => \$ispackage, 'compare=s{2}' =>\@compare, 'new' => \$isnewformat);
27
7dccd04e54f9 gettd.pl v0.5, support for bklog compare and fix feature count
victorp@symbian.org
parents: 26
diff changeset
   311
7dccd04e54f9 gettd.pl v0.5, support for bklog compare and fix feature count
victorp@symbian.org
parents: 26
diff changeset
   312
  if (@compare) {
7dccd04e54f9 gettd.pl v0.5, support for bklog compare and fix feature count
victorp@symbian.org
parents: 26
diff changeset
   313
	compare_bklogs @compare;
7dccd04e54f9 gettd.pl v0.5, support for bklog compare and fix feature count
victorp@symbian.org
parents: 26
diff changeset
   314
	
7dccd04e54f9 gettd.pl v0.5, support for bklog compare and fix feature count
victorp@symbian.org
parents: 26
diff changeset
   315
  }
22
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   316
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   317
  if ($help) {
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   318
    printhelp;
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   319
  }
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   320
27
7dccd04e54f9 gettd.pl v0.5, support for bklog compare and fix feature count
victorp@symbian.org
parents: 26
diff changeset
   321
24
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 23
diff changeset
   322
 if ($ispackage) {
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 23
diff changeset
   323
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 23
diff changeset
   324
 	$tdomain =" ";
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 23
diff changeset
   325
	$target_url = "http://developer.symbian.org/wiki/index.php/Category:Package_Backlog";
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 23
diff changeset
   326
	
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 23
diff changeset
   327
 }  
67
4ed9a3a59ef8 gettd.p version 0.6
victorp@symbian.org
parents: 32
diff changeset
   328
 if ($isnewformat){
4ed9a3a59ef8 gettd.p version 0.6
victorp@symbian.org
parents: 32
diff changeset
   329
    $newtdformat = 1;
24
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 23
diff changeset
   330
 
67
4ed9a3a59ef8 gettd.p version 0.6
victorp@symbian.org
parents: 32
diff changeset
   331
 }
24
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 23
diff changeset
   332
22
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   333
 if ( not $target_url) {
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   334
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   335
	print "ERROR-missing arguments target url\n";
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   336
	printhelp;	
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   337
  } 
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   338
24
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 23
diff changeset
   339
22
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   340
 if (not $tdomain){
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   341
	print "ERROR-missing arguments domain level\n";
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   342
	printhelp;
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   343
 }
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   344
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   345
 	print "\nINFO-downloading $target_url with label $tdomain\n";
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   346
  
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   347
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   348
 if (not $csvfile) {
27
7dccd04e54f9 gettd.pl v0.5, support for bklog compare and fix feature count
victorp@symbian.org
parents: 26
diff changeset
   349
	if (not $ispackage) { 
7dccd04e54f9 gettd.pl v0.5, support for bklog compare and fix feature count
victorp@symbian.org
parents: 26
diff changeset
   350
		$csvfile="output.csv";
32
9cd541fe26d1 gettd.pl fix to bug that stopped tech roadmaps from being added up into the same file. Introduced in v0.5
victorp@symbian.org
parents: 31
diff changeset
   351
		
27
7dccd04e54f9 gettd.pl v0.5, support for bklog compare and fix feature count
victorp@symbian.org
parents: 26
diff changeset
   352
	} else {
7dccd04e54f9 gettd.pl v0.5, support for bklog compare and fix feature count
victorp@symbian.org
parents: 26
diff changeset
   353
		$csvfile="output.txt";
7dccd04e54f9 gettd.pl v0.5, support for bklog compare and fix feature count
victorp@symbian.org
parents: 26
diff changeset
   354
		system ("rm *output.txt");
31
d1d21a2aeabc gettd.pl version 0.5 support for format analysis and bash file executable
victorp@symbian.org
parents: 27
diff changeset
   355
	
27
7dccd04e54f9 gettd.pl v0.5, support for bklog compare and fix feature count
victorp@symbian.org
parents: 26
diff changeset
   356
	}
22
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   357
 }
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   358
 print "\nINFO-output recorded in $csvfile \n";
23
8fb98cf0b1ac remove authentication as default, added -a option for cookies
victorp@symbian.org
parents: 22
diff changeset
   359
31
d1d21a2aeabc gettd.pl version 0.5 support for format analysis and bash file executable
victorp@symbian.org
parents: 27
diff changeset
   360
                                      
22
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   361
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   362
}
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   363
#main
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   364
$/ = " ";
24
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 23
diff changeset
   365
$host1 = "developer.symbian.org";
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 23
diff changeset
   366
23
8fb98cf0b1ac remove authentication as default, added -a option for cookies
victorp@symbian.org
parents: 22
diff changeset
   367
cmd_options();
22
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   368
23
8fb98cf0b1ac remove authentication as default, added -a option for cookies
victorp@symbian.org
parents: 22
diff changeset
   369
if ($authon) {
8fb98cf0b1ac remove authentication as default, added -a option for cookies
victorp@symbian.org
parents: 22
diff changeset
   370
	#file containing login details from http cookie
8fb98cf0b1ac remove authentication as default, added -a option for cookies
victorp@symbian.org
parents: 22
diff changeset
   371
	$mycookie = loadfile("mycookie.txt");
22
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   372
23
8fb98cf0b1ac remove authentication as default, added -a option for cookies
victorp@symbian.org
parents: 22
diff changeset
   373
	$auth = "Cookie: " . $mycookie ;
8fb98cf0b1ac remove authentication as default, added -a option for cookies
victorp@symbian.org
parents: 22
diff changeset
   374
}
22
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   375
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   376
24
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 23
diff changeset
   377
if ($ispackage) {
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 23
diff changeset
   378
	getpage($target_url, $host1, $auth, "debug.txt");
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 23
diff changeset
   379
	@bklog = parse_category("debug.txt");
26
cad9fdd53748 gettd.pl v0.04 - fix to delete empty lines
victorp@symbian.org
parents: 25
diff changeset
   380
	$j=0;
31
d1d21a2aeabc gettd.pl version 0.5 support for format analysis and bash file executable
victorp@symbian.org
parents: 27
diff changeset
   381
	
24
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 23
diff changeset
   382
	foreach (@bklog) {
26
cad9fdd53748 gettd.pl v0.04 - fix to delete empty lines
victorp@symbian.org
parents: 25
diff changeset
   383
		getpage("http://".$host1.$_, $host1, $auth, "pkg".$j.".txt");
27
7dccd04e54f9 gettd.pl v0.5, support for bklog compare and fix feature count
victorp@symbian.org
parents: 26
diff changeset
   384
		parse_bklog ("pkg".$j.".txt",$csvfile, $j);
26
cad9fdd53748 gettd.pl v0.04 - fix to delete empty lines
victorp@symbian.org
parents: 25
diff changeset
   385
		$j++;
24
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 23
diff changeset
   386
		
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 23
diff changeset
   387
	
22
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   388
24
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 23
diff changeset
   389
	}
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 23
diff changeset
   390
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 23
diff changeset
   391
} else {
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 23
diff changeset
   392
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 23
diff changeset
   393
	#foundation releases - add as required
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 23
diff changeset
   394
	@releases=("Symbian\\^2","Symbian\\^3","Symbian\\^4");
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 23
diff changeset
   395
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 23
diff changeset
   396
	getpage($target_url, $host1, $auth, "debug.txt");
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 23
diff changeset
   397
	td_roadmap("debug.txt" , $csvfile, $tdomain ,@releases);
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 23
diff changeset
   398
}