summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorJanne Anttila <janne.anttila@digia.com>2009-09-03 11:35:17 +0300
committerJanne Anttila <janne.anttila@digia.com>2009-09-03 11:35:17 +0300
commit0a3ae605065c879493e17c83164b6770bd874532 (patch)
tree00004b41a80b391efa2d16289bacf4ade62324e4 /bin
parent2f43359a21a7d268d367097fc327cc205019cc97 (diff)
Fixed patch_capabilites to patch also template pkg UID.
Reviewed-by: Miikka Heikkinen
Diffstat (limited to 'bin')
-rw-r--r--bin/patch_capabilities.pl29
1 files changed, 23 insertions, 6 deletions
diff --git a/bin/patch_capabilities.pl b/bin/patch_capabilities.pl
index ca80891a80..cf8353eab5 100644
--- a/bin/patch_capabilities.pl
+++ b/bin/patch_capabilities.pl
@@ -26,17 +26,26 @@ if (@ARGV)
# Parse the first given script argument as a ".pkg" file name.
my $pkgFileName = shift(@ARGV);
- # Check if using template .pkg and do preprocessing if needed
+ # These variables will only be set for template .pkg files.
+ my $target;
+ my $platform;
+
+ # Check if using template .pkg and set target/platform variables
if (($pkgFileName =~ m|_template\.pkg$|i) && -r($pkgFileName))
{
- my $target;
- unless ($target = shift(@ARGV))
+ my $targetplatform;
+ unless ($targetplatform = shift(@ARGV))
{
Usage();
}
- system ("createpackage.bat -p ".$pkgFileName." ".$target);
- $pkgFileName =~ s/_template\.pkg/_${target}\.pkg/;
+ my @tmpvalues = split('-', $targetplatform);
+ $target = $tmpvalues[0];
+ $platform = $tmpvalues[1];
+
+ # Convert visual target to real target (debug->udeb and release->urel)
+ $target =~ s/debug/udeb/i;
+ $target =~ s/release/urel/i;
}
# If the specified ".pkg" file exists (and can be read),
@@ -80,8 +89,16 @@ if (@ARGV)
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|\$\(TARGET\))/(\w+(\.dll|\.exe)):i)
{
+ # Do preprocessing for template pkg,
+ # In case of template pkg target and platform variables are set
+ if(length($target) && length($platform))
+ {
+ $sourcePath =~ s/\$\(PLATFORM\)/$platform/gm;
+ $sourcePath =~ s/\$\(TARGET\)/$target/gm;
+ }
+
push (@binaries, $sourcePath);
}
}