diff options
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/createpackage.pl | 90 | ||||
-rwxr-xr-x | bin/syncqt | 39 |
2 files changed, 77 insertions, 52 deletions
diff --git a/bin/createpackage.pl b/bin/createpackage.pl index 5738aeb..1d6ab6b 100755 --- a/bin/createpackage.pl +++ b/bin/createpackage.pl @@ -54,6 +54,8 @@ use Getopt::Long; use File::Basename; # Use File::Spec services mainly rel2abs use File::Spec; +# Use File::Path - to make stub sis target directory +use File::Path; # use CWD abs_bath, which is exported only on request use Cwd 'abs_path'; @@ -111,11 +113,13 @@ my $install = ""; my $preprocessonly = ""; my $certfile = ""; my $preserveUnsigned = ""; +my $stub = ""; unless (GetOptions('i|install' => \$install, 'p|preprocess' => \$preprocessonly, 'c|certfile=s' => \$certfile, - 'u|unsigned' => \$preserveUnsigned,)){ + 'u|unsigned' => \$preserveUnsigned, + 's|stub' => \$stub,)){ Usage(); } @@ -153,6 +157,7 @@ my $sisoutputbasename = lc($pkgoutputbasename); $sisoutputbasename =~ s/_$targetplatform//g; my $unsigned_sis_name = $sisoutputbasename."_unsigned.sis"; my $signed_sis_name = $sisoutputbasename.".sis"; +my $stub_sis_name = $sisoutputbasename."_stub.sis"; # Store some utility variables my $scriptpath = dirname(__FILE__); @@ -254,48 +259,57 @@ if ($preprocessonly) { exit; } -# Create SIS. -system ("makesis $pkgoutput $unsigned_sis_name"); - -# Sign SIS with certificate info given as an argument. -system ("signsis $unsigned_sis_name $signed_sis_name $certificate $key $passphrase"); - -# Check if creating signed SIS Succeeded -stat($signed_sis_name); -if( -e _ ) { - my $targetInsert = ""; - if ($targetplatform ne "-") { - $targetInsert = "for $targetplatform "; - } - print ("\nSuccessfully created $signed_sis_name ${targetInsert}using certificate: $certtext!\n"); +if($stub) { + if(!($ENV{EPOCROOT})) { die("EPOCROOT must be set to create stub sis files"); } + my $systeminstall = "$ENV{EPOCROOT}epoc32/data/z/system/install"; + mkpath($systeminstall); + my $stub_sis_name = $systeminstall."/".$stub_sis_name; + # Create stub SIS. + system ("makesis -s $pkgoutput $stub_sis_name"); +} else { + # Create SIS. + system ("makesis $pkgoutput $unsigned_sis_name"); + print("\n"); + + # Sign SIS with certificate info given as an argument. + system ("signsis $unsigned_sis_name $signed_sis_name $certificate $key $passphrase"); + + # Check if creating signed SIS Succeeded + stat($signed_sis_name); + if( -e _ ) { + my $targetInsert = ""; + if ($targetplatform ne "-") { + $targetInsert = "for $targetplatform "; + } + print ("Successfully created $signed_sis_name ${targetInsert}using certificate: $certtext!\n"); - # Sign with additional certificates & keys - for my $row ( @certificates ) { - # Get certificate absolute file names, relative paths are relative to certfilepath - my $abscert = File::Spec->rel2abs( $row->[0], $certfilepath); - my $abskey = File::Spec->rel2abs( $row->[1], $certfilepath); + # Sign with additional certificates & keys + for my $row ( @certificates ) { + # Get certificate absolute file names, relative paths are relative to certfilepath + my $abscert = File::Spec->rel2abs( $row->[0], $certfilepath); + my $abskey = File::Spec->rel2abs( $row->[1], $certfilepath); - system ("signsis $signed_sis_name $signed_sis_name $abscert $abskey $row->[2]"); - print ("\tAdditionally signed the SIS with certificate: $row->[0]!\n"); - } + system ("signsis $signed_sis_name $signed_sis_name $abscert $abskey $row->[2]"); + print ("\tAdditionally signed the SIS with certificate: $row->[0]!\n"); + } - # remove temporary pkg and unsigned sis - if (!$preservePkgOutput) { - unlink $pkgoutput; - } - if (!$preserveUnsigned) { - unlink $unsigned_sis_name; - } + # remove temporary pkg and unsigned sis + if (!$preservePkgOutput) { + unlink $pkgoutput; + } + if (!$preserveUnsigned) { + unlink $unsigned_sis_name; + } - # Install the sis if requested - if ($install) { - print ("\nInstalling $signed_sis_name...\n"); - system ("$signed_sis_name"); + # Install the sis if requested + if ($install) { + print ("\nInstalling $signed_sis_name...\n"); + system ("$signed_sis_name"); + } + } else { + # Lets leave the generated PKG for problem solving purposes + print ("\nSIS creation failed!\n"); } -} else { - # Lets leave the generated PKG for problem solving purposes - print ("\nSIS creation failed!\n"); } - #end of file @@ -62,6 +62,7 @@ my %moduleheaders = ( # restrict the module headers to those found in relative p # global variables (modified by options) my $module = 0; my $showonly = 0; +my $quiet = 0; my $remove_stale = 1; my $force_win = 0; my $force_relative = 0; @@ -92,6 +93,7 @@ sub showUsage print " -windows Force platform to Windows (default: " . ($force_win ? "yes" : "no") . ")\n"; print " -showonly Show action but not perform (default: " . ($showonly ? "yes" : "no") . ")\n"; print " -outdir <PATH> Specify output directory for sync (default: $out_basedir)\n"; + print " -quiet Only report problems, not activity (default: " . ($quiet ? "yes" : "no") . ")\n"; print " -separate-module <NAME>:<PROFILEDIR>:<HEADERDIR> Create headers for <NAME> with original headers in <HEADERDIR> relative to <PROFILEDIR> \n"; print " -help This help\n"; exit 0; @@ -324,7 +326,7 @@ sub syncHeader { unless(-e "$header") { my $header_dir = dirname($header); - mkpath $header_dir, 0777; + mkpath $header_dir, !$quiet; #write it my $iheader_out = fixPaths($iheader, $header_dir); @@ -464,7 +466,7 @@ sub copyFile if ( $knowdiff || ($filecontents ne $ifilecontents) ) { if ( $copy > 0 ) { my $file_dir = dirname($file); - mkpath $file_dir, 0777 unless(-e "$file_dir"); + mkpath $file_dir, !$quiet unless(-e "$file_dir"); open(O, "> " . $file) || die "Could not open $file for writing (no write permission?)"; local $/; binmode O; @@ -473,7 +475,7 @@ sub copyFile return 1; } elsif ( $copy < 0 ) { my $ifile_dir = dirname($ifile); - mkpath $ifile_dir, 0777 unless(-e "$ifile_dir"); + mkpath $ifile_dir, !$quiet unless(-e "$ifile_dir"); open(O, "> " . $ifile) || die "Could not open $ifile for writing (no write permission?)"; local $/; binmode O; @@ -499,7 +501,7 @@ sub symlinkFile my ($file,$ifile) = @_; if ($isunix) { - print "symlink created for $file "; + print "symlink created for $file " unless $quiet; if ( $force_relative && ($ifile =~ /^$basedir/)) { my $t = getcwd(); my $c = -1; @@ -507,9 +509,9 @@ sub symlinkFile $t =~ s-^$basedir/--; $p .= "../" while( ($c = index( $t, "/", $c + 1)) != -1 ); $file =~ s-^$basedir/-$p-; - print " ($file)\n"; + print " ($file)\n" unless $quiet; } - print "\n"; + print "\n" unless $quiet; return symlink($file, $ifile); } return copyFile($file, $ifile); @@ -593,6 +595,9 @@ while ( @ARGV ) { } elsif("$arg" eq "-show") { $var = "showonly"; $val = "yes"; + } elsif("$arg" eq "-quiet") { + $var = "quiet"; + $val = "yes"; } elsif("$arg" eq "-base-dir") { # skip, it's been dealt with at the top of the file shift @ARGV; @@ -615,6 +620,12 @@ while ( @ARGV ) { } elsif($showonly) { $showonly--; } + } elsif ("$var" eq "quiet") { + if("$val" eq "yes") { + $quiet++; + } elsif($quiet) { + $quiet--; + } } elsif ("$var" eq "check-includes") { if("$val" eq "yes") { $check_includes++; @@ -640,7 +651,7 @@ while ( @ARGV ) { $force_relative--; } } elsif ("$var" eq "module") { - print "module :$val:\n"; + print "module :$val:\n" unless $quiet; die "No such module: $val" unless(defined $modules{$val}); push @modules_to_sync, $val; } elsif ("$var" eq "separate-module") { @@ -668,7 +679,7 @@ while ( @ARGV ) { $isunix = checkUnix; #cache checkUnix # create path -mkpath "$out_basedir/include", 0777; +mkpath "$out_basedir/include", !$quiet; my @ignore_headers = (); my $class_lib_map_contents = ""; @@ -871,7 +882,7 @@ foreach (@modules_to_sync) { $pri_install_pfiles.= "$pri_install_iheader ";; } } - print "header created for $iheader ($header_copies)\n" if($header_copies > 0); + print "header created for $iheader ($header_copies)\n" if($header_copies > 0 && !$quiet); } } } @@ -898,8 +909,8 @@ foreach (@modules_to_sync) { } if($master_include && $master_contents) { my $master_dir = dirname($master_include); - mkpath $master_dir, 0777; - print "header (master) created for $lib\n"; + mkpath $master_dir, !$quiet; + print "header (master) created for $lib\n" unless $quiet; open MASTERINCLUDE, ">$master_include"; print MASTERINCLUDE "$master_contents"; close MASTERINCLUDE; @@ -923,8 +934,8 @@ foreach (@modules_to_sync) { } if($headers_pri_file && $master_contents) { my $headers_pri_dir = dirname($headers_pri_file); - mkpath $headers_pri_dir, 0777; - print "headers.pri file created for $lib\n"; + mkpath $headers_pri_dir, !$quiet; + print "headers.pri file created for $lib\n" unless $quiet; open HEADERS_PRI_FILE, ">$headers_pri_file"; print HEADERS_PRI_FILE "$headers_pri_contents"; close HEADERS_PRI_FILE; @@ -944,7 +955,7 @@ unless($showonly || !$create_uic_class_map) { } if($class_lib_map) { my $class_lib_map_dir = dirname($class_lib_map); - mkpath $class_lib_map_dir, 0777; + mkpath $class_lib_map_dir, !$quiet; open CLASS_LIB_MAP, ">$class_lib_map"; print CLASS_LIB_MAP "$class_lib_map_contents"; close CLASS_LIB_MAP; |