Add --norev option to ignore the revision information in packagelists (mostly for the default hg pull behaviour) PDK_3.0.3 PDK_4.0.a
authorWilliam Roberts <williamr@symbian.org>
Thu, 30 Sep 2010 11:54:42 +0100
changeset 298 28c70cc5e86f
parent 297 c52fbeec9580
child 299 c0fb460d1a21
Add --norev option to ignore the revision information in packagelists (mostly for the default hg pull behaviour) Improve the csv file parsing to allow spaces in the comma-separated information Remove the export_control_special_case in line with the main website practice Add a distinct hostname for the pushurl, so we pull from "developer.symbian.org" and push to "developer-secure.symbian.org"
clone_packages/clone_all_packages.pl
--- a/clone_packages/clone_all_packages.pl	Thu Sep 30 11:52:34 2010 +0100
+++ b/clone_packages/clone_all_packages.pl	Thu Sep 30 11:54:42 2010 +0100
@@ -59,6 +59,7 @@
 -filter <RE>   only process repository paths matching regular expression <RE>
 -dummyrun      Dummy Run, don't execute any Mercurial commands.
 -webhost       Web Mercurial host (defaults to developer.symbian.org)
+-norev         Ignore any revision information in packagelist
 
 The -exec option processes the rest of the command line, treating it as
 a command to apply to each repository in turn. Some keywords are expanded
@@ -81,7 +82,9 @@
 
 my @clone_options = (); # use ("--noupdate") to clone without extracting the source
 my @pull_options  = (); # use ("--rebase") to rebase your changes when pulling
-my $hostname = "developer-secure.symbian.org";
+my $hostname = "developer.symbian.org";
+my $pushhostname = "developer-secure.symbian.org";
+my $webhost_option = "";
 
 my $username = "";
 my $password = "";
@@ -92,6 +95,7 @@
 my $help = 0;
 my $exec = 0;
 my $filter = "";
+my $norev = 0; # ignore revision information in packagelist files
 my @packagelist_files = ();
 
 # Analyse the rest of command-line parameters
@@ -107,7 +111,8 @@
     "f|filter=s" => \$filter,
     "l|packagelist=s" => \@packagelist_files,
     "d|dummyrun" => \$do_nothing,
-    "w|webhost=s" => \$hostname,
+    "w|webhost=s" => \$webhost_option,
+    "norev" => \$norev,
     ))
   {
   Usage("Invalid argument");
@@ -117,6 +122,12 @@
 Usage("Too few arguments for -exec") if (scalar @ARGV == 0 && $exec);
 Usage("") if ($help);
 
+if ($webhost_option)
+	{
+	$hostname = $webhost_option;
+	$pushhostname = $webhost_option;
+	}
+
 # Important: This script uses http access to the repositories, so
 # the username and password will be stored as cleartext in the
 # .hg/hgrc file in each repository.
@@ -151,11 +162,6 @@
   chomp $password;
   }
 
-my %export_control_special_case = (
-  "oss/MCL/sf/os/security" => 1,
-  "oss/FCL/sf/os/security" => 1,
-  );
-
 sub do_system(@)
   {
   my (@cmd) = @_;
@@ -199,9 +205,9 @@
   
   $path .= "/$destdir";   # this is where the repository will go
 
-  my $repo_url = "https://$username:$password\@$hostname/$package/";
-  my $repo_push_url =$repo_url;
-  if ($license ne "sfl" && !$export_control_special_case{$package})
+  my $repo_push_url = "https://$username:$password\@$pushhostname/$package/";
+  my $repo_url = $repo_push_url;
+  if ($license ne "sfl")
     {
     # user registration is not required for reading public package repositories
     $repo_url = "http://$hostname/$package/";
@@ -209,7 +215,7 @@
   
   my @rev_options = ();
   my $revision = $revisions{$package};
-  if (defined($revision))
+  if (defined($revision) && $norev == 0)
     {
     @rev_options = ("--rev", $revision);
     }
@@ -314,7 +320,7 @@
  		# sources.csv format
  		# http://developer.symbian.org/oss/FCL/sf/app/browserui/,/sf/app/browserui,tag,tip_bulk,layers.sysdef.xml
  		# http://developer.symbian.org/oss/FCL/sf/app/browserui/,/sf/app/browserui,changeset,e086c7f635d5,layers.sysdef.xml
-		if ($line =~ /^(http[^,]+),(\S+),\S+,(\S+),\S*$/)
+		if ($line =~ /^(http[^,]+),([^,]+),[^,]+,([^,]+),.*$/)
 			{
 			$line = $1;
 			$revision = $3;