diff options
author | Miikka Heikkinen <miikka.heikkinen@digia.com> | 2009-05-13 14:06:59 (GMT) |
---|---|---|
committer | Miikka Heikkinen <miikka.heikkinen@digia.com> | 2009-05-13 14:06:59 (GMT) |
commit | 9bd9a52549bc8e0069051ad36b55ab0c7dda06ab (patch) | |
tree | 8957a1a3621ee421a8c4bdd02e88c90ca21f4a76 /bin | |
parent | 92f58608aa0bac53ed64450b5d94c879eb01cbc3 (diff) | |
parent | 23788fc8431d80f7d7f613685ff8571d576a73a2 (diff) | |
download | Qt-9bd9a52549bc8e0069051ad36b55ab0c7dda06ab.zip Qt-9bd9a52549bc8e0069051ad36b55ab0c7dda06ab.tar.gz Qt-9bd9a52549bc8e0069051ad36b55ab0c7dda06ab.tar.bz2 |
Merge branch 'master' of git@scm.dev.troll.no:qt/qt-s60-public
Diffstat (limited to 'bin')
-rw-r--r-- | bin/patch_capabilities.pl | 46 |
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"); |