diff options
author | Miikka Heikkinen <miikka.heikkinen@digia.com> | 2011-04-13 08:58:40 (GMT) |
---|---|---|
committer | Miikka Heikkinen <miikka.heikkinen@digia.com> | 2011-04-13 10:23:38 (GMT) |
commit | 01477af79d8114b3f8993c3967892538a599dfa6 (patch) | |
tree | a622da930f5eb3ab15b591b2ab66e94623a9b92e /bin/createpackage.pl | |
parent | 930db5826ff2c02d54f2851494000c5fab97da54 (diff) | |
download | Qt-01477af79d8114b3f8993c3967892538a599dfa6.zip Qt-01477af79d8114b3f8993c3967892538a599dfa6.tar.gz Qt-01477af79d8114b3f8993c3967892538a599dfa6.tar.bz2 |
Improve logic to find default certificates in createpackage script
Original implementation assumed createpackage script was always run
from under Qt source tree bin directory, which is not always the case
as on some platforms the Qt tools can be found from under EPOCROOT.
Fixed it so that if the default directory for default certificates
can't be found in the expected location, createpackage will attempt to
query qmake in the same directory as the createpackage script for the
location of the Qt source tree (QT_INSTALL_PREFIX) and look for default
certificates directory from under there.
Task-number: QTBUG-18684
Reviewed-by: Janne Koskinen
Diffstat (limited to 'bin/createpackage.pl')
-rwxr-xr-x | bin/createpackage.pl | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/bin/createpackage.pl b/bin/createpackage.pl index b7457e1..aae20ae 100755 --- a/bin/createpackage.pl +++ b/bin/createpackage.pl @@ -238,11 +238,7 @@ if ($templatepkg =~ m/_installer\.pkg$/i && $onlyUnsigned) { my $unsigned_sis_name = $sisoutputbasename."_unsigned.sis"; my $stub_sis_name = $sisoutputbasename.".sis"; -# Store some utility variables -my $scriptpath = dirname(__FILE__); my $certtext = $certificate; -# certificates are one step up in hierarchy -my $certpath = File::Spec->catdir($scriptpath, File::Spec->updir(), "src/s60installs/"); # Check some pre-conditions and print error messages if needed. unless (length($templatepkg)) { @@ -265,6 +261,16 @@ if (length($certificate)) { } } else { #If no certificate is given, check default options + my $scriptpath = dirname(__FILE__); + my $certpath = File::Spec->catdir($scriptpath, File::Spec->updir(), "src/s60installs"); + + unless (-e $certpath) { + my $qmakeCmd = File::Spec->catfile($scriptpath, "qmake"); + $certpath = `$qmakeCmd -query QT_INSTALL_PREFIX`; + $certpath =~ s/\s+$//; + $certpath = File::Spec->catdir($certpath, "src/s60installs"); + } + $certtext = "RnD"; $certificate = File::Spec->catfile($certpath, "rd.cer"); $key = File::Spec->catfile($certpath, "rd-key.pem"); |