# HG changeset patch # User Shabe Razvi # Date 1270030419 -3600 # Node ID 9a43fe34cdb4fc48b8333134727699d5f7392b64 # Parent aabab255ad7bd61f9a6d9bf44dfa201ce8816ffb# Parent 28714977dccbdf1a9f40216e770427955bc19f52 Merge diff -r aabab255ad7b -r 9a43fe34cdb4 common/templates/source-spec.ant.xml.ftl --- 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 @@ - + <#assign fileset = "" /> <#assign sync_list = "" /> <#assign bom_list = "" /> @@ -28,7 +28,16 @@ - + + + + + + + + + + @@ -82,12 +91,7 @@ - - - - - - + @@ -102,12 +106,7 @@ - - - - - - + diff -r aabab255ad7b -r 9a43fe34cdb4 common/tools/BuildEnv.xml --- 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 @@ - diff -r aabab255ad7b -r 9a43fe34cdb4 common/tools/findPhysicalDrive.pl --- 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; diff -r aabab255ad7b -r 9a43fe34cdb4 common/tools/populateziptemplate.pl --- 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") {