summaryrefslogtreecommitdiffstats
path: root/bin/createpackage.pl
diff options
context:
space:
mode:
authorJørgen Lind <jorgen.lind@nokia.com>2011-01-04 14:17:44 (GMT)
committerJørgen Lind <jorgen.lind@nokia.com>2011-01-04 14:17:44 (GMT)
commitfc013b7be66a6d4fc13af8bd38b7e679ed3998af (patch)
treecc068fa05bbc357bce89f8c6dfe37d6308704a1e /bin/createpackage.pl
parentbe41c140594ccea16ce17ccca7251d614cc75e1e (diff)
parent4d53a691aaac9789ddd4f9d4e968d28ace2181ca (diff)
downloadQt-fc013b7be66a6d4fc13af8bd38b7e679ed3998af.zip
Qt-fc013b7be66a6d4fc13af8bd38b7e679ed3998af.tar.gz
Qt-fc013b7be66a6d4fc13af8bd38b7e679ed3998af.tar.bz2
Merge branch 'master' into lighthouse-master
Diffstat (limited to 'bin/createpackage.pl')
-rwxr-xr-xbin/createpackage.pl29
1 files changed, 18 insertions, 11 deletions
diff --git a/bin/createpackage.pl b/bin/createpackage.pl
index 522d1fb..87ed29e 100755
--- a/bin/createpackage.pl
+++ b/bin/createpackage.pl
@@ -82,6 +82,8 @@ Where supported options are as follows:
[-s|stub] = Generates stub sis for ROM.
[-n|sisname <name>] = Specifies the final sis name.
[-g|gcce-is-armv5] = Convert gcce platform to armv5.
+ [-d|dont-patch] = Skip automatic patching of capabilities and pkg file if default certificate
+ is used. Instead non-self-signable capabilities just cause warnings.
Where parameters are as follows:
templatepkg = Name of .pkg file template
target = Either debug or release
@@ -127,6 +129,7 @@ my $stub = "";
my $signed_sis_name = "";
my $onlyUnsigned = "";
my $convertGcce = "";
+my $dontPatchCaps = "";
unless (GetOptions('i|install' => \$install,
'p|preprocess' => \$preprocessonly,
@@ -135,16 +138,19 @@ unless (GetOptions('i|install' => \$install,
'o|only-unsigned' => \$onlyUnsigned,
's|stub' => \$stub,
'n|sisname=s' => \$signed_sis_name,
- 'g|gcce-is-armv5' => \$convertGcce,)) {
+ 'g|gcce-is-armv5' => \$convertGcce,
+ 'd|dont-patch' => \$dontPatchCaps,)) {
Usage();
}
my $epocroot = $ENV{EPOCROOT};
+my $epocToolsDir = "";
if ($epocroot ne "") {
$epocroot =~ s,\\,/,g;
if ($epocroot =~ m,[^/]$,) {
$epocroot = $epocroot."/";
}
+ $epocToolsDir = "${epocroot}epoc32/tools/";
}
my $certfilepath = abs_path(dirname($certfile));
@@ -337,24 +343,25 @@ if($stub) {
mkpath($systeminstall);
my $stub_sis_name = $systeminstall."/".$stub_sis_name;
# Create stub SIS.
- system ("${epocroot}epoc32/tools/makesis -s $pkgoutput $stub_sis_name");
+ system ("${epocToolsDir}makesis -s $pkgoutput $stub_sis_name");
} else {
if ($certtext eq "Self Signed"
&& !@certificates
&& $templatepkg !~ m/_installer\.pkg$/i
&& !$onlyUnsigned) {
- print("Auto-patching capabilities for self signed package.\n");
my $patch_capabilities = File::Spec->catfile(dirname($0), "patch_capabilities");
- system ("$patch_capabilities $pkgoutput") and die ("ERROR: Automatic patching failed");
+ if ($dontPatchCaps) {
+ system ("$patch_capabilities -c $pkgoutput") and print ("Warning: Package check for self-signing viability failed. Installing the package on a device will most likely fail!\n\n");
+ } else {
+ print("Auto-patching self-signed package.\n");
+ system ("$patch_capabilities $pkgoutput") and die ("ERROR: Automatic patching failed");
+ }
}
# Create SIS.
# The 'and' is because system uses 0 to indicate success.
- if($epocroot) {
- system ("${epocroot}epoc32/tools/makesis $pkgoutput $unsigned_sis_name") and die ("ERROR: makesis failed");
- } else {
- system ("makesis $pkgoutput $unsigned_sis_name") and die ("ERROR: makesis failed");
- }
+ system ("${epocToolsDir}makesis $pkgoutput $unsigned_sis_name") and die ("ERROR: makesis failed");
+
print("\n");
my $targetInsert = "";
@@ -381,7 +388,7 @@ if($stub) {
my $relcert = File::Spec->abs2rel($certificate);
my $relkey = File::Spec->abs2rel($key);
# The 'and' is because system uses 0 to indicate success.
- system ("signsis $unsigned_sis_name $signed_sis_name $relcert $relkey $passphrase") and die ("ERROR: signsis failed");
+ system ("${epocToolsDir}signsis $unsigned_sis_name $signed_sis_name $relcert $relkey $passphrase") and die ("ERROR: signsis failed");
# Check if creating signed SIS Succeeded
stat($signed_sis_name);
@@ -394,7 +401,7 @@ if($stub) {
my $relcert = File::Spec->abs2rel(File::Spec->rel2abs( $row->[0], $certfilepath));
my $relkey = File::Spec->abs2rel(File::Spec->rel2abs( $row->[1], $certfilepath));
- system ("signsis $signed_sis_name $signed_sis_name $relcert $relkey $row->[2]");
+ system ("${epocToolsDir}signsis $signed_sis_name $signed_sis_name $relcert $relkey $row->[2]");
print ("\tAdditionally signed the SIS with certificate: $row->[0]!\n");
}