tdroadmap_merger/gettd.pl
author victorp@symbian.org
Fri, 14 Aug 2009 09:43:24 +0100
changeset 33 9cd541fe26d1
parent 32 d1d21a2aeabc
child 68 4ed9a3a59ef8
permissions -rw-r--r--
gettd.pl fix to bug that stopped tech roadmaps from being added up into the same file. Introduced in v0.5
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
28
7dccd04e54f9 gettd.pl v0.5, support for bklog compare and fix feature count
victorp@symbian.org
parents: 27
diff changeset
     1
#!/usr/bin/perl
7dccd04e54f9 gettd.pl v0.5, support for bklog compare and fix feature count
victorp@symbian.org
parents: 27
diff changeset
     2
23
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
24
8fb98cf0b1ac remove authentication as default, added -a option for cookies
victorp@symbian.org
parents: 23
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: 23
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: 23
diff changeset
    11
my $csvfile; #output csv file name
25
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 24
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: 24
diff changeset
    13
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 24
diff changeset
    14
my $ispackage;
32
d1d21a2aeabc gettd.pl version 0.5 support for format analysis and bash file executable
victorp@symbian.org
parents: 28
diff changeset
    15
my $summaryheader="ID\tPackage\tFeatures\tFormat\tHttp\n" ;
28
7dccd04e54f9 gettd.pl v0.5, support for bklog compare and fix feature count
victorp@symbian.org
parents: 27
diff changeset
    16
23
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
    17
sub getpage
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
    18
{
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
    19
	#arguments
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
    20
	($page,$host,$auth,$myfile)=@_;
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
    21
	
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
	#output file
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
    24
	open ( outputfile, ">".$myfile);
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
    25
	
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
	$port = "http(80)";
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
    28
	$getmess = "GET " . $page ." HTTP/1.1\n" . $auth;
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
    29
24
8fb98cf0b1ac remove authentication as default, added -a option for cookies
victorp@symbian.org
parents: 23
diff changeset
    30
	print "INFO - sending message - $getmess\n";
23
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
    31
	print outputfile "$getmess\n\n";
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
    32
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
    33
	$sock = IO::Socket::INET->new 	
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
    34
		(
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
    35
		 PeerAddr => $host,   PeerPort => $port,  Proto => 'tcp', 
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
    36
		) ;
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
	print $sock "$getmess\n\n";
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
    40
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
	while(<$sock>) {
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
    43
 
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
    44
	  print outputfile $_;
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
    45
 
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
	close ($sock);
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
    49
	close (outputfile);
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
    50
}
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
sub prntfeatures 
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
    53
{
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
	($release,$package,$features,$myfile,$domain)=@_;
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
    56
	
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
    57
	$features = $features."<dt";
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
    58
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
    59
	
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
    60
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
    61
	while ( $features =~ /dt\>(.*?)\<\/dt(.*?)\<dt/sg  ){
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
    62
		$myfeat = $1;
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
    63
		$subfeat =$2;
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
    64
		
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
    65
		$myfeat =~ s/\n/ /sg;
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
    66
		
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
    67
		pos($features) = pos($features) -2;
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
		$mystr="";
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
    70
		while ( $subfeat =~ /\<dd\>(.*?)\<\/dd\>/sg) {
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
    71
			$mysubfeat = $mysubfeat.$mystr.$1;
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
    72
			$mystr = " & ";
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
		undef $mystr;
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
    75
	$mysubfeat =~ s/,/ /sg;
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
    76
	$mysubfeat =~ s/\n//sg;
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
    77
	$mysubfeat =~ s/\<.*?\>//sg;
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
    78
	
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
    79
	$release =~ s/\\//sg;	
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
    80
	print $myfile " $release, $domain, $package, $myfeat, $mysubfeat\n";
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
    81
	
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
    82
	$mysubfeat = "";	
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
    83
	}
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
    84
		
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
    85
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
    86
}
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
    87
	
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
    88
sub loadfile
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
    89
{
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
	$/ = " ";
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
    92
	#arguments
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
    93
	($myfile)=@_;
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
    94
	open ( inputfile, "<".$myfile);
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
    95
	my $contents = do { local $/;  <inputfile> };
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
    96
	close(inputfile);
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
    97
	return $contents;
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
sub td_roadmap
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   102
{
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   103
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   104
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   105
	#arguments
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   106
	($infile,$outfile,$domain,@releases)=@_;
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
	$roadmap=loadfile $infile;
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   110
	open ( outputfile, ">>".$outfile);
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
	foreach (@releases) {
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   115
		
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   116
		$exp="\\<h2\\>.*?\\>".$_;
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
		if ($roadmap =~ m /($exp)/sg) { 
24
8fb98cf0b1ac remove authentication as default, added -a option for cookies
victorp@symbian.org
parents: 23
diff changeset
   119
			print "PASS - Found entry for $_ \n";
23
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   120
			$relroad =$';	
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   121
			
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   122
			if ($relroad =~ m /(.*?)\<h2/sg) { $relroad =$1;}
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   123
			$i=0;	
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   124
			while ($relroad=~ m/\<h3\>.*\>(.*?)\<.*<\/h3/g) {
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   125
				$package = $1;		
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   126
				$ppos[$i]= pos($relroad);
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   127
				$pname[$i]= $package;
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   128
				$i++;
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   129
			}
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   130
			for ( $i=0;$i<($#ppos); $i++){
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   131
				$features= substr ($relroad, $ppos[$i],$ppos[$i+1]-$ppos[$i]);
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   132
				prntfeatures($_,$pname[$i],$features,outputfile,$domain);
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   133
			}
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   134
			$features= substr ($relroad, $ppos[$i]);
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   135
		
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   136
			prntfeatures($_,$pname[$i],$features,outputfile,$domain);
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   137
			@ppos ="";
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   138
			@pname ="";
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   139
			undef ($features);
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   140
		}
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   141
			 	
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   142
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   143
	}
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   144
	
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   145
	
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   146
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   147
	close (outputfile);
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   148
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   149
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   150
}
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   151
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   152
25
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 24
diff changeset
   153
sub parse_category {
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 24
diff changeset
   154
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 24
diff changeset
   155
	#arguments
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 24
diff changeset
   156
	($infile)=@_;
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 24
diff changeset
   157
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 24
diff changeset
   158
	my @mylink;
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 24
diff changeset
   159
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 24
diff changeset
   160
	$mypage=loadfile $infile;
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 24
diff changeset
   161
	$i=0;	
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 24
diff changeset
   162
	if ( $mypage =~ m/Pages in category(.*)\<\/table/sg) {
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 24
diff changeset
   163
		print "INFO - Category page found\n";
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 24
diff changeset
   164
		$mypage = $1;
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 24
diff changeset
   165
		while ($mypage =~ m /\<a href\=\"(\/wiki\/index\.php\/.*?)\"/g) {
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 24
diff changeset
   166
			
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 24
diff changeset
   167
			$mylink[$i] = $1;	
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 24
diff changeset
   168
			$i++;
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 24
diff changeset
   169
			
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 24
diff changeset
   170
		}
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 24
diff changeset
   171
	print "INFO - Found $i items in the category page\n"
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 24
diff changeset
   172
	}
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 24
diff changeset
   173
	return @mylink;
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 24
diff changeset
   174
}
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 24
diff changeset
   175
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 24
diff changeset
   176
sub parse_bklog {
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 24
diff changeset
   177
	
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 24
diff changeset
   178
	#arguments
28
7dccd04e54f9 gettd.pl v0.5, support for bklog compare and fix feature count
victorp@symbian.org
parents: 27
diff changeset
   179
	($infile,$outfile,$id)=@_;
25
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 24
diff changeset
   180
	$mypkg=loadfile $infile;
32
d1d21a2aeabc gettd.pl version 0.5 support for format analysis and bash file executable
victorp@symbian.org
parents: 28
diff changeset
   181
	#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: 28
diff changeset
   182
  $headerformat= "wiki_format";
d1d21a2aeabc gettd.pl version 0.5 support for format analysis and bash file executable
victorp@symbian.org
parents: 28
diff changeset
   183
	
25
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 24
diff changeset
   184
	open ( outputfile, ">>".$outfile);
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 24
diff changeset
   185
	open ( soutputfile, ">>"."summary_".$outfile);
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 24
diff changeset
   186
	
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 24
diff changeset
   187
	if ($mypkg =~ m/index\.php\/(.*?) HTTP/sg) {
28
7dccd04e54f9 gettd.pl v0.5, support for bklog compare and fix feature count
victorp@symbian.org
parents: 27
diff changeset
   188
  
25
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 24
diff changeset
   189
		$pagename = $1;
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 24
diff changeset
   190
		print "INFO -Processing Package $pagename \n";
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 24
diff changeset
   191
		$i=0;
28
7dccd04e54f9 gettd.pl v0.5, support for bklog compare and fix feature count
victorp@symbian.org
parents: 27
diff changeset
   192
		
7dccd04e54f9 gettd.pl v0.5, support for bklog compare and fix feature count
victorp@symbian.org
parents: 27
diff changeset
   193
		while ($mypkg =~ m/\<tr.*?\>(.*?)\<\/tr/sg) {
32
d1d21a2aeabc gettd.pl version 0.5 support for format analysis and bash file executable
victorp@symbian.org
parents: 28
diff changeset
   194
			$myheader= $&;
d1d21a2aeabc gettd.pl version 0.5 support for format analysis and bash file executable
victorp@symbian.org
parents: 28
diff changeset
   195
      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: 28
diff changeset
   196
        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: 28
diff changeset
   197
        next;
d1d21a2aeabc gettd.pl version 0.5 support for format analysis and bash file executable
victorp@symbian.org
parents: 28
diff changeset
   198
      }
25
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 24
diff changeset
   199
			$myfeat= $1;
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 24
diff changeset
   200
			$myfeat =~ s/\<\/td\>/\t/sg;
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 24
diff changeset
   201
			$myfeat =~ s/\<.*?\>//sg;
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 24
diff changeset
   202
			$myfeat =~ s/\n//sg;
27
cad9fdd53748 gettd.pl v0.04 - fix to delete empty lines
victorp@symbian.org
parents: 26
diff changeset
   203
			
28
7dccd04e54f9 gettd.pl v0.5, support for bklog compare and fix feature count
victorp@symbian.org
parents: 27
diff changeset
   204
			
7dccd04e54f9 gettd.pl v0.5, support for bklog compare and fix feature count
victorp@symbian.org
parents: 27
diff changeset
   205
			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: 27
diff changeset
   206
			not $myfeat =~ m/\&lt\;Feature/sg and not $myfeat =~ m/Item not available/sg) {
27
cad9fdd53748 gettd.pl v0.04 - fix to delete empty lines
victorp@symbian.org
parents: 26
diff changeset
   207
				print outputfile "$pagename\t$myfeat\n";
cad9fdd53748 gettd.pl v0.04 - fix to delete empty lines
victorp@symbian.org
parents: 26
diff changeset
   208
				$i++;
cad9fdd53748 gettd.pl v0.04 - fix to delete empty lines
victorp@symbian.org
parents: 26
diff changeset
   209
			}
25
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 24
diff changeset
   210
			
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 24
diff changeset
   211
		}
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 24
diff changeset
   212
32
d1d21a2aeabc gettd.pl version 0.5 support for format analysis and bash file executable
victorp@symbian.org
parents: 28
diff changeset
   213
	print soutputfile "$id\t$pagename\t$i\t$headerformat\thttp://developer.symbian.org/wiki/index.php/$pagename\n";
25
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 24
diff changeset
   214
	
28
7dccd04e54f9 gettd.pl v0.5, support for bklog compare and fix feature count
victorp@symbian.org
parents: 27
diff changeset
   215
25
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 24
diff changeset
   216
	}
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 24
diff changeset
   217
28
7dccd04e54f9 gettd.pl v0.5, support for bklog compare and fix feature count
victorp@symbian.org
parents: 27
diff changeset
   218
	close (outputfile);
7dccd04e54f9 gettd.pl v0.5, support for bklog compare and fix feature count
victorp@symbian.org
parents: 27
diff changeset
   219
	close (soutputfile);
7dccd04e54f9 gettd.pl v0.5, support for bklog compare and fix feature count
victorp@symbian.org
parents: 27
diff changeset
   220
7dccd04e54f9 gettd.pl v0.5, support for bklog compare and fix feature count
victorp@symbian.org
parents: 27
diff changeset
   221
7dccd04e54f9 gettd.pl v0.5, support for bklog compare and fix feature count
victorp@symbian.org
parents: 27
diff changeset
   222
}
7dccd04e54f9 gettd.pl v0.5, support for bklog compare and fix feature count
victorp@symbian.org
parents: 27
diff changeset
   223
25
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 24
diff changeset
   224
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 24
diff changeset
   225
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 24
diff changeset
   226
23
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   227
#help print
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   228
sub printhelp
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   229
{
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   230
32
d1d21a2aeabc gettd.pl version 0.5 support for format analysis and bash file executable
victorp@symbian.org
parents: 28
diff changeset
   231
	print "\n\n version 0.5
28
7dccd04e54f9 gettd.pl v0.5, support for bklog compare and fix feature count
victorp@symbian.org
parents: 27
diff changeset
   232
	\ngettd.pl -t=url -d=domain \n\nrequired parameters:\n\t -t url containing the technology domain roadmap\n\t -d the technology domain name
7dccd04e54f9 gettd.pl v0.5, support for bklog compare and fix feature count
victorp@symbian.org
parents: 27
diff changeset
   233
	\n\nOptional parameters\n\t-o filename ,the output is logged into the output.csv file by default\n\t-h for help
7dccd04e54f9 gettd.pl v0.5, support for bklog compare and fix feature count
victorp@symbian.org
parents: 27
diff changeset
   234
	\n\t-a setup authorisation by cookie follow instructions \n\tin http://developer.symbian.org/wiki/index.php/Roadmap_merger_script#Cookies
7dccd04e54f9 gettd.pl v0.5, support for bklog compare and fix feature count
victorp@symbian.org
parents: 27
diff changeset
   235
	\n\t -p adds support for package backlog analysis. just run gettd.pl -p
32
d1d21a2aeabc gettd.pl version 0.5 support for format analysis and bash file executable
victorp@symbian.org
parents: 28
diff changeset
   236
	\n\t -compare [f1] [f2] compares two package summary files for changes ignores order
d1d21a2aeabc gettd.pl version 0.5 support for format analysis and bash file executable
victorp@symbian.org
parents: 28
diff changeset
   237
  \n\t recommend to run under cygwin environment\n";
23
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   238
	exit;
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   239
}
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   240
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   241
28
7dccd04e54f9 gettd.pl v0.5, support for bklog compare and fix feature count
victorp@symbian.org
parents: 27
diff changeset
   242
7dccd04e54f9 gettd.pl v0.5, support for bklog compare and fix feature count
victorp@symbian.org
parents: 27
diff changeset
   243
#compare bklogs
7dccd04e54f9 gettd.pl v0.5, support for bklog compare and fix feature count
victorp@symbian.org
parents: 27
diff changeset
   244
sub compare_bklogs {
7dccd04e54f9 gettd.pl v0.5, support for bklog compare and fix feature count
victorp@symbian.org
parents: 27
diff changeset
   245
	#arguments
7dccd04e54f9 gettd.pl v0.5, support for bklog compare and fix feature count
victorp@symbian.org
parents: 27
diff changeset
   246
	(@bklogs)=@_;
7dccd04e54f9 gettd.pl v0.5, support for bklog compare and fix feature count
victorp@symbian.org
parents: 27
diff changeset
   247
	
7dccd04e54f9 gettd.pl v0.5, support for bklog compare and fix feature count
victorp@symbian.org
parents: 27
diff changeset
   248
	if (not $#bklogs == 1) { printhelp;}
7dccd04e54f9 gettd.pl v0.5, support for bklog compare and fix feature count
victorp@symbian.org
parents: 27
diff changeset
   249
7dccd04e54f9 gettd.pl v0.5, support for bklog compare and fix feature count
victorp@symbian.org
parents: 27
diff changeset
   250
	
7dccd04e54f9 gettd.pl v0.5, support for bklog compare and fix feature count
victorp@symbian.org
parents: 27
diff changeset
   251
	$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: 27
diff changeset
   252
	
7dccd04e54f9 gettd.pl v0.5, support for bklog compare and fix feature count
victorp@symbian.org
parents: 27
diff changeset
   253
	system($cmd);
7dccd04e54f9 gettd.pl v0.5, support for bklog compare and fix feature count
victorp@symbian.org
parents: 27
diff changeset
   254
	
7dccd04e54f9 gettd.pl v0.5, support for bklog compare and fix feature count
victorp@symbian.org
parents: 27
diff changeset
   255
	$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: 27
diff changeset
   256
	system($cmd);
7dccd04e54f9 gettd.pl v0.5, support for bklog compare and fix feature count
victorp@symbian.org
parents: 27
diff changeset
   257
	
7dccd04e54f9 gettd.pl v0.5, support for bklog compare and fix feature count
victorp@symbian.org
parents: 27
diff changeset
   258
	exec ("diff tmp1.txt tmp2.txt | grep '[<|>]'");
7dccd04e54f9 gettd.pl v0.5, support for bklog compare and fix feature count
victorp@symbian.org
parents: 27
diff changeset
   259
	system("rm temp*.txt");
7dccd04e54f9 gettd.pl v0.5, support for bklog compare and fix feature count
victorp@symbian.org
parents: 27
diff changeset
   260
	
7dccd04e54f9 gettd.pl v0.5, support for bklog compare and fix feature count
victorp@symbian.org
parents: 27
diff changeset
   261
	exit;
7dccd04e54f9 gettd.pl v0.5, support for bklog compare and fix feature count
victorp@symbian.org
parents: 27
diff changeset
   262
7dccd04e54f9 gettd.pl v0.5, support for bklog compare and fix feature count
victorp@symbian.org
parents: 27
diff changeset
   263
}
7dccd04e54f9 gettd.pl v0.5, support for bklog compare and fix feature count
victorp@symbian.org
parents: 27
diff changeset
   264
7dccd04e54f9 gettd.pl v0.5, support for bklog compare and fix feature count
victorp@symbian.org
parents: 27
diff changeset
   265
7dccd04e54f9 gettd.pl v0.5, support for bklog compare and fix feature count
victorp@symbian.org
parents: 27
diff changeset
   266
7dccd04e54f9 gettd.pl v0.5, support for bklog compare and fix feature count
victorp@symbian.org
parents: 27
diff changeset
   267
23
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   268
#process command line options
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   269
sub cmd_options
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   270
{
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   271
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   272
  my $help;
28
7dccd04e54f9 gettd.pl v0.5, support for bklog compare and fix feature count
victorp@symbian.org
parents: 27
diff changeset
   273
  my @compare;
23
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   274
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   275
28
7dccd04e54f9 gettd.pl v0.5, support for bklog compare and fix feature count
victorp@symbian.org
parents: 27
diff changeset
   276
  GetOptions('h' => \$help,'t=s'=> \$target_url, 'd=s' => \$tdomain , 'o=s' => \$csvfile, 
7dccd04e54f9 gettd.pl v0.5, support for bklog compare and fix feature count
victorp@symbian.org
parents: 27
diff changeset
   277
	'a' => \$authon , 'p' => \$ispackage, 'compare=s{2}' =>\@compare);
7dccd04e54f9 gettd.pl v0.5, support for bklog compare and fix feature count
victorp@symbian.org
parents: 27
diff changeset
   278
7dccd04e54f9 gettd.pl v0.5, support for bklog compare and fix feature count
victorp@symbian.org
parents: 27
diff changeset
   279
  if (@compare) {
7dccd04e54f9 gettd.pl v0.5, support for bklog compare and fix feature count
victorp@symbian.org
parents: 27
diff changeset
   280
	compare_bklogs @compare;
7dccd04e54f9 gettd.pl v0.5, support for bklog compare and fix feature count
victorp@symbian.org
parents: 27
diff changeset
   281
	
7dccd04e54f9 gettd.pl v0.5, support for bklog compare and fix feature count
victorp@symbian.org
parents: 27
diff changeset
   282
  }
23
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   283
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   284
  if ($help) {
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   285
    printhelp;
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   286
  }
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   287
28
7dccd04e54f9 gettd.pl v0.5, support for bklog compare and fix feature count
victorp@symbian.org
parents: 27
diff changeset
   288
25
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 24
diff changeset
   289
 if ($ispackage) {
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 24
diff changeset
   290
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 24
diff changeset
   291
 	$tdomain =" ";
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 24
diff changeset
   292
	$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: 24
diff changeset
   293
	
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 24
diff changeset
   294
 }  
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 24
diff changeset
   295
 
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 24
diff changeset
   296
23
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   297
 if ( not $target_url) {
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   298
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   299
	print "ERROR-missing arguments target url\n";
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   300
	printhelp;	
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   301
  } 
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   302
25
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 24
diff changeset
   303
23
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   304
 if (not $tdomain){
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   305
	print "ERROR-missing arguments domain level\n";
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   306
	printhelp;
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
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   309
 	print "\nINFO-downloading $target_url with label $tdomain\n";
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   310
  
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   311
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   312
 if (not $csvfile) {
28
7dccd04e54f9 gettd.pl v0.5, support for bklog compare and fix feature count
victorp@symbian.org
parents: 27
diff changeset
   313
	if (not $ispackage) { 
7dccd04e54f9 gettd.pl v0.5, support for bklog compare and fix feature count
victorp@symbian.org
parents: 27
diff changeset
   314
		$csvfile="output.csv";
33
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: 32
diff changeset
   315
		
28
7dccd04e54f9 gettd.pl v0.5, support for bklog compare and fix feature count
victorp@symbian.org
parents: 27
diff changeset
   316
	} else {
7dccd04e54f9 gettd.pl v0.5, support for bklog compare and fix feature count
victorp@symbian.org
parents: 27
diff changeset
   317
		$csvfile="output.txt";
7dccd04e54f9 gettd.pl v0.5, support for bklog compare and fix feature count
victorp@symbian.org
parents: 27
diff changeset
   318
		system ("rm *output.txt");
32
d1d21a2aeabc gettd.pl version 0.5 support for format analysis and bash file executable
victorp@symbian.org
parents: 28
diff changeset
   319
	
28
7dccd04e54f9 gettd.pl v0.5, support for bklog compare and fix feature count
victorp@symbian.org
parents: 27
diff changeset
   320
	}
23
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   321
 }
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   322
 print "\nINFO-output recorded in $csvfile \n";
24
8fb98cf0b1ac remove authentication as default, added -a option for cookies
victorp@symbian.org
parents: 23
diff changeset
   323
32
d1d21a2aeabc gettd.pl version 0.5 support for format analysis and bash file executable
victorp@symbian.org
parents: 28
diff changeset
   324
                                      
23
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   325
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   326
}
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   327
#main
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   328
$/ = " ";
25
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 24
diff changeset
   329
$host1 = "developer.symbian.org";
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 24
diff changeset
   330
24
8fb98cf0b1ac remove authentication as default, added -a option for cookies
victorp@symbian.org
parents: 23
diff changeset
   331
cmd_options();
23
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   332
24
8fb98cf0b1ac remove authentication as default, added -a option for cookies
victorp@symbian.org
parents: 23
diff changeset
   333
if ($authon) {
8fb98cf0b1ac remove authentication as default, added -a option for cookies
victorp@symbian.org
parents: 23
diff changeset
   334
	#file containing login details from http cookie
8fb98cf0b1ac remove authentication as default, added -a option for cookies
victorp@symbian.org
parents: 23
diff changeset
   335
	$mycookie = loadfile("mycookie.txt");
23
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   336
24
8fb98cf0b1ac remove authentication as default, added -a option for cookies
victorp@symbian.org
parents: 23
diff changeset
   337
	$auth = "Cookie: " . $mycookie ;
8fb98cf0b1ac remove authentication as default, added -a option for cookies
victorp@symbian.org
parents: 23
diff changeset
   338
}
23
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   339
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   340
25
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 24
diff changeset
   341
if ($ispackage) {
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 24
diff changeset
   342
	getpage($target_url, $host1, $auth, "debug.txt");
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 24
diff changeset
   343
	@bklog = parse_category("debug.txt");
27
cad9fdd53748 gettd.pl v0.04 - fix to delete empty lines
victorp@symbian.org
parents: 26
diff changeset
   344
	$j=0;
32
d1d21a2aeabc gettd.pl version 0.5 support for format analysis and bash file executable
victorp@symbian.org
parents: 28
diff changeset
   345
	
25
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 24
diff changeset
   346
	foreach (@bklog) {
27
cad9fdd53748 gettd.pl v0.04 - fix to delete empty lines
victorp@symbian.org
parents: 26
diff changeset
   347
		getpage("http://".$host1.$_, $host1, $auth, "pkg".$j.".txt");
28
7dccd04e54f9 gettd.pl v0.5, support for bklog compare and fix feature count
victorp@symbian.org
parents: 27
diff changeset
   348
		parse_bklog ("pkg".$j.".txt",$csvfile, $j);
27
cad9fdd53748 gettd.pl v0.04 - fix to delete empty lines
victorp@symbian.org
parents: 26
diff changeset
   349
		$j++;
25
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 24
diff changeset
   350
		
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 24
diff changeset
   351
	
23
dbe87093a3ca adding roadmap_merger script - first version
victorp@symbian.org
parents:
diff changeset
   352
25
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 24
diff changeset
   353
	}
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 24
diff changeset
   354
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 24
diff changeset
   355
} else {
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 24
diff changeset
   356
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 24
diff changeset
   357
	#foundation releases - add as required
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 24
diff changeset
   358
	@releases=("Symbian\\^2","Symbian\\^3","Symbian\\^4");
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 24
diff changeset
   359
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 24
diff changeset
   360
	getpage($target_url, $host1, $auth, "debug.txt");
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 24
diff changeset
   361
	td_roadmap("debug.txt" , $csvfile, $tdomain ,@releases);
7a2c092f0fbf update to roadmap merger to support package backlog analysis
victorp@symbian.org
parents: 24
diff changeset
   362
}