Skip to content

Commit

Permalink
Fixed patch_capabilites to patch also template pkg UID.
Browse files Browse the repository at this point in the history
Reviewed-by: Miikka Heikkinen
  • Loading branch information
Janne Anttila committed Sep 3, 2009
1 parent 2f43359 commit 0a3ae60
Showing 1 changed file with 23 additions and 6 deletions.
29 changes: 23 additions & 6 deletions bin/patch_capabilities.pl
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,26 @@ ()
# 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),
Expand Down Expand Up @@ -80,8 +89,16 @@ ()
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);
}
}
Expand Down

0 comments on commit 0a3ae60

Please sign in to comment.