Merge
authorShabe Razvi <shaber@symbian.org>
Wed, 31 Mar 2010 11:13:39 +0100
changeset 1017 9a43fe34cdb4
parent 1016 aabab255ad7b (current diff)
parent 955 28714977dccb (diff)
child 1026 9983d8eb2250
Merge
--- a/common/templates/source-spec.ant.xml.ftl	Tue Mar 30 10:23:25 2010 +0100
+++ b/common/templates/source-spec.ant.xml.ftl	Wed Mar 31 11:13:39 2010 +0100
@@ -5,7 +5,7 @@
 
     <!-- Convert \s in cache location, because otherwise they disappear entirely when used in a regex replacement! -->
     <propertyregex property="sf.spec.sourcesync.cachelocation.for.regex" input="${dollar}{sf.spec.sourcesync.cachelocation}" regexp="\\" replace="/" global="true" defaultValue="${dollar}{sf.spec.sourcesync.cachelocation}"/>
-    
+
 <#assign fileset = "" />
 <#assign sync_list = "" />
 <#assign bom_list  = "" />
@@ -28,7 +28,16 @@
                 <propertyregex property="sf.spec.sourcesync.cachelocation.${count}" input="${pkg_detail.source}" regexp="^${ant['sf.spec.sourcesync.local.development.area']}/" casesensitive="false" replace="${dollar}{sf.spec.sourcesync.cachelocation.for.regex}/LocalDev/"/>
             </then>
         </if>
-	
+        
+        <!-- Convert source tag/branch to to changeset hash, in case it's a local tag on the server -->
+        <exec executable="hg" outputproperty="sf.sourcesync.${count}.checksum">
+            <arg value="id"/>
+            <arg value="${pkg_detail.source}"/>
+            <arg value="-r"/>
+            <arg value="${pkg_detail.pattern}"/>
+            <arg value="-q"/>
+        </exec>
+        
         <if>
             <and>
                 <isset property="sf.spec.sourcesync.cachelocation.${count}"/>
@@ -82,12 +91,7 @@
                 <exec executable="hg" dir="${ant['build.drive']}${pkg_detail.dst}" failonerror="true">
                     <arg value="update"/>
                     <arg value="-r"/>
-                    <arg value="${pkg_detail.pattern}"/>
-                </exec>
-                <!-- Record the changeset selected, for the BOM -->
-                <exec executable="hg" dir="${ant['build.drive']}${pkg_detail.dst}" outputproperty="sf.sourcesync.${count}.checksum">
-                    <arg value="identify"/>
-                    <arg value="-i"/>
+                    <arg value="${dollar}{sf.sourcesync.${count}.checksum}"/>
                 </exec>
             </then>
             <else>
@@ -102,12 +106,7 @@
                 <exec executable="hg" dir="${ant['build.drive']}${pkg_detail.dst}" failonerror="true">
                     <arg value="update"/>
                     <arg value="-r"/>
-                    <arg value="${pkg_detail.pattern}"/>
-                </exec>
-                <!-- Record the changeset selected, for the BOM -->
-                <exec executable="hg" dir="${ant['build.drive']}${pkg_detail.dst}" outputproperty="sf.sourcesync.${count}.checksum">
-                    <arg value="identify"/>
-                    <arg value="-i"/>
+                    <arg value="${dollar}{sf.sourcesync.${count}.checksum}"/>
                 </exec>
                 <if>
                     <isset property="sf.spec.sourcesync.cachelocation.${count}"/>
--- a/common/tools/BuildEnv.xml	Tue Mar 30 10:23:25 2010 +0100
+++ b/common/tools/BuildEnv.xml	Wed Mar 31 11:13:39 2010 +0100
@@ -75,7 +75,6 @@
 			<location strict="false" value="C:\Symbian\Tools\PDT_1.0\helium\hlm.bat"/>
 			<verify version="5.0" showstopper="true">
 				<check var="HELIUM_HOME" values="[CD]:\\Symbian\\Tools\\PDT_1.\d\\helium"/>
-				<check name="version" execute="%HELIUM_HOME%\hlm.bat -f %HELIUM_HOME%\build.xml version" values="5\.\d" locator="Helium version: ([\d\.]+)"/>
 			</verify>
 		</tool>
 		<tool name="Raptor">
--- a/common/tools/findPhysicalDrive.pl	Tue Mar 30 10:23:25 2010 +0100
+++ b/common/tools/findPhysicalDrive.pl	Wed Mar 31 11:13:39 2010 +0100
@@ -20,6 +20,7 @@
 use strict;
 
 use Getopt::Long;
+use Win32::OLE;
 
 # Read option arguments
 my $option;
@@ -43,65 +44,35 @@
 	exit(1);
 }
 
-# Use Windows command to list physical volumes on the machine
-# (No substed drives, or mapped network drives)
-my @details = map {chomp;$_} `echo list volume | diskpart`;
-
-my @drives;
-my %space;
-my %capacity;
-for my $driveLine (@details)
-{
-	# If this line of output is actually about a healthy HD volume...
-	if ($driveLine =~ m{^\s+Volume \d+\s+([A-Z]).*?(Partition|RAID-5)\s+(\d+) ([A-Z]+)\s+Healthy} )
-	{
-		my ($letter, $capacityValue, $capacityUnit) = ($1, $3, $4);
-		
-		my %multiplier = (
-			MB => 1000000,
-			GB => 1000000000,
-			TB => 1000000000000,
-		);
+# Connect to WMI services on this machine (".")
+my $wmiServices = Win32::OLE->GetObject( "winmgmts:{impersonationLevel=impersonate,(security)}//." ) or die;
+# Get list of all volumes (drive letters)
+my @volumes = Win32::OLE::in($wmiServices->InstancesOf( "Win32_LogicalDisk" ));
+# Get list of substed drives
+my %subst = map { (substr $_, 0, 2) => 1 } `subst`;
+# Filter volumes to remove non-Partitions, and substed drives
+@volumes = grep { $_->{DriveType} == 3 && !exists $subst{$_->{DeviceID}} } @volumes;
+# Also remove the system drive (usually C:) unless it's the only drive in the box!
+@volumes = grep { $_->{DeviceID} ne $ENV{SystemDrive} } @volumes if scalar(@volumes) > 1;
 
-		if (not exists $multiplier{$capacityUnit})
-		{
-			warn "Don't know how to interpret $capacityValue $capacityUnit\n";
-			next;
-		}
-		$capacityValue *= $multiplier{$capacityUnit};
-
-		# Ignore the system drive
-		next if ($driveLine =~ m{System\s*$});
-
-		# Use dir to get the freespace (bytes)
-		my @bytesFree = grep { s{^.*?(\d+) bytes free\s*$}{$1} } map {chomp;$_} `cmd /c dir /-C /A $letter:\\`;
-		# Take the value from the bottom of the report
-		my $bytesFree = $bytesFree[-1];
-
-		# Record info for this volume
-		push @drives, $letter;
-		$space{$bytesFree} = $letter;
-		$capacity{$capacityValue} = $letter;
-	}
-}
-
-die "Unable to find any suitable drives at all\n" unless %space;
+die "Unable to find any suitable drives at all\n" unless @volumes;
 
 if ($option->{all})
 {
-	print join ",", map { "$_:" } @drives;
+	print join ",", map { $_->{DeviceID} } @volumes;
 	print "\n";
-	exit;
 }
 elsif ($option->{capacity})
 {
 	# Sort by capacity to find the largest volume and print out the corresponding letter
-	print "$capacity{(reverse sort keys %capacity)[0]}:\n";
+	@volumes = reverse sort { $a->{Size} <=> $b->{Size} } @volumes;
+	print "$volumes[0]->{DeviceID}\n";
 }
 elsif ($option->{space})
 {
 	# Sort by space to find the volume with the largest amount of space and print out the corresponding letter
-	print "$space{(reverse sort keys %space)[0]}:\n";
+	@volumes = reverse sort { $a->{FreeSpace} <=> $b->{FreeSpace} } @volumes;
+	print "$volumes[0]->{DeviceID}\n";
 }
 
 exit;
--- a/common/tools/populateziptemplate.pl	Tue Mar 30 10:23:25 2010 +0100
+++ b/common/tools/populateziptemplate.pl	Wed Mar 31 11:13:39 2010 +0100
@@ -72,19 +72,17 @@
 {
 	warn "Warning: Package $package->{dst} does not appear on the local system\n" unless -d $package->{dst};
 	$package->{dst} =~ s{^/}{}g;
-	if ($package->{source} =~ m{/(sfl|oss)/(MCL|FCL)/(sf|utilities|interim)/(([^/]+)/)?([^/]+)?})
+	if ($package->{source} =~ m{/(sfl|oss)/(MCL|FCL)/(sf|sftools|interim)/(([^/]+)/)?([^/]+)?})
 	{
 		my ($license, $codeline, $thingy, $layer, $packageName) = ($1, $2, $3, $5, $6);
 		# $thingy is the part of the path after the codeline. For
 		# platform packages, it's "sf". For the utilities package, it's
-		# "utilities" (the name of the package) and there's no more
-		# path.
+		# "sftools".
 		#
 		# I can't think of anything to describe this item, hence $thingy
-		if ($thingy eq "utilities")
+		if ($thingy eq "sftools")
 		{
 			$layer = "tools";
-			$packageName = "utilities";
 		}
 		elsif ($thingy eq "interim")
 		{