summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorMiikka Heikkinen <miikka.heikkinen@digia.com>2009-05-13 11:34:18 (GMT)
committerMiikka Heikkinen <miikka.heikkinen@digia.com>2009-05-13 11:34:18 (GMT)
commit8262a1cf35400117293fe2dd2e866ad42478ab29 (patch)
treeb68729af540e5def726114ed8dff5c36c01f63a3 /bin
parent6eb4a47a56914ca65d11736af5c0d758755d0291 (diff)
downloadQt-8262a1cf35400117293fe2dd2e866ad42478ab29.zip
Qt-8262a1cf35400117293fe2dd2e866ad42478ab29.tar.gz
Qt-8262a1cf35400117293fe2dd2e866ad42478ab29.tar.bz2
Fixed pkg file parsing in patch_capabilities.pl
Diffstat (limited to 'bin')
-rw-r--r--bin/patch_capabilities.pl46
1 files changed, 23 insertions, 23 deletions
diff --git a/bin/patch_capabilities.pl b/bin/patch_capabilities.pl
index 586e7b0..d75605b 100644
--- a/bin/patch_capabilities.pl
+++ b/bin/patch_capabilities.pl
@@ -14,7 +14,7 @@ if (@ARGV)
{
# Parse the first given script argument as a ".pkg" file name.
my $pkgFileName = shift(@ARGV);
-
+
# If the specified ".pkg" file exists (and can be read),
if (($pkgFileName =~ m|\.pkg$|i) && -r($pkgFileName))
{
@@ -27,44 +27,44 @@ if (@ARGV)
push (@capabilitiesToSet, pop(@ARGV));
}
}
-
+
# Start with no binaries listed.
my @binaries = ();
-
+
# Open the ".pkg" file.
- open (PKG, "<".$pkgFileName);
-
+ open (PKG, "<".$pkgFileName);
+
# Parse each line.
while (<PKG>)
{
my $line = $_;
- chomp ($line);
-
+ chomp ($line);
+
# If the line specifies a file, parse the source and destination locations.
if ($line =~ m|\"([^\"]+)\"\s*\-\s*\"([^\"]+)\"|)
{
my $sourcePath = $1;
my $destinationPath = $2;
-
+
# If the given file is a binary, check the target and binary type (+ the actual filename) from its path.
- if ($sourcePath =~ m:\\epoc32\\release\\([^\\]+)\\(udeb|urel)\\(\w+(\.dll|\.exe)):i)
+ if ($sourcePath =~ m:/epoc32/release/([^/]+)/(udeb|urel)/(\w+(\.dll|\.exe)):i)
{
push (@binaries, $sourcePath);
}
}
}
-
+
# Close the ".pkg" file.
close (PKG);
-
+
print ("\n");
-
- my $baseCommandToExecute = "elftran -capability \"";
+
+ my $baseCommandToExecute = "elftran -capability \"";
if (@capabilitiesToSet)
- {
+ {
$baseCommandToExecute .= join(" ", @capabilitiesToSet);
- }
- $baseCommandToExecute .= "\" ";
+ }
+ $baseCommandToExecute .= "\" ";
# Actually set the capabilities of the listed binaries.
foreach my $binaryPath(@binaries)
@@ -72,19 +72,19 @@ if (@ARGV)
# Create the command line for setting the capabilities.
my $commandToExecute = $baseCommandToExecute;
$commandToExecute .= $binaryPath;
-
+
# Actually execute the elftran command to set the capabilities.
system ($commandToExecute." > NUL");
print ("Executed ".$commandToExecute."\n");
-
+
## Create another command line to check that the set capabilities are correct.
- #$commandToExecute = "elftran -dump s ".$binaryPath;
- }
-
+ #$commandToExecute = "elftran -dump s ".$binaryPath;
+ }
+
print ("\n");
}
-}
-else
+}
+else
{
print("This script can be used to set capabilities of all binaries\n");
print("specified for deployment in a .pkg file.\n");