[Libreoffice-commits] .: Branch 'libreoffice-3-3' - 2 commits - instsetoo_native/util solenv/bin

Michael Meeks mmeeks at kemper.freedesktop.org
Tue Nov 30 06:08:51 PST 2010


 instsetoo_native/util/openoffice.lst     |    2 
 solenv/bin/modules/installer/download.pm |  193 ++++++-------------------------
 2 files changed, 42 insertions(+), 153 deletions(-)

New commits:
commit 26bc64ef9e223e82f8098bbf36f01eeda3b6cdc1
Author: Michael Meeks <michael.meeks at novell.com>
Date:   Tue Nov 30 14:09:09 2010 +0000

    Add BrOffice artwork / branding support
    
    Conflicts:
    
    	solenv/bin/modules/installer/download.pm

diff --git a/instsetoo_native/util/openoffice.lst b/instsetoo_native/util/openoffice.lst
index 50c5890..6731ca4 100644
--- a/instsetoo_native/util/openoffice.lst
+++ b/instsetoo_native/util/openoffice.lst
@@ -92,6 +92,8 @@ LibreOffice
 			PATCHCODEFILE ooo_patchcodes.txt
 			DOWNLOADBANNER	ooobanner.bmp
 			DOWNLOADBITMAP	ooobitmap.bmp
+			DOWNLOADBANNER_BR	brobanner.bmp
+			DOWNLOADBITMAP_BR	brobitmap.bmp
 			DOWNLOADSETUPICO	ooosetup.ico
 			RELATIVE_PATHES_IN_DDF 1
             STARTCENTER_ADDFEATURE_URL http://extensions.libreoffice.org/
diff --git a/solenv/bin/modules/installer/download.pm b/solenv/bin/modules/installer/download.pm
index 664f319..b6c3d37 100644
--- a/solenv/bin/modules/installer/download.pm
+++ b/solenv/bin/modules/installer/download.pm
@@ -118,8 +118,7 @@ sub save_script_file
 
     if ( ! $installer::globals::iswindowsbuild )
     {
-        my $localcall = "chmod 775 $newscriptfilename \>\/dev\/null 2\>\&1";
-        system($localcall);
+        chmod 0775, $newscriptfilename;
     }
     
     return $newscriptfilename;
@@ -339,8 +338,7 @@ sub tar_package
         push( @installer::globals::logfileinfo, $infoline);
     }
     
-    my $localcall = "chmod 775 $tarfilename \>\/dev\/null 2\>\&1";
-    $returnvalue = system($localcall);
+    chmod 0775, $tarfilename;
 
     return ( -s $tarfilename );
 }
@@ -443,14 +441,6 @@ sub get_downloadname_language
         $languages =~ s/_en-US//;
     }
 
-    # en-US is default language and can be removed therefore
-    # for one-language installation sets
-    
-    # if ( $languages =~ /^\s*en-US\s*$/ )
-    # {
-    #	$languages = "";
-    # }	
-
     if ( length ($languages) > $installer::globals::max_lang_length )
     {
         $languages = 'multi';
@@ -592,7 +582,6 @@ sub get_download_platformname
     }
     else
     {
-        # $platformname = $installer::globals::packageformat;
         $platformname = $installer::globals::compiler;		
     }
     
@@ -753,7 +742,6 @@ sub get_current_version
     my $infoline = "";
     my $versionstring = "";
     my $filename = "version.info";
-    # $filename = $installer::globals::ooouploaddir . $installer::globals::separator . $filename;
     
     if ( -f $filename )
     {
@@ -983,46 +971,16 @@ sub put_windows_productname_into_template
 }
 
 ##################################################################
-# Windows: Including the path to the banner.bmp into nsi template 
+# Windows: Substituting the path to a file into the nsi template
 ##################################################################
 
-sub put_banner_bmp_into_template
+sub substitute_path_into_template
 {
-    my ($templatefile, $includepatharrayref, $allvariables) = @_;
-    
-    # my $filename = "downloadbanner.bmp";
-    if ( ! $allvariables->{'DOWNLOADBANNER'} ) { installer::exiter::exit_program("ERROR: DOWNLOADBANNER not defined in product definition!", "put_banner_bmp_into_template"); }
-    my $filename = $allvariables->{'DOWNLOADBANNER'};
+    my ($templatefile, $includepatharrayref, $allvariables, $var, $subst) = @_;
 
-    my $completefilenameref = "";
-
-    if ( $installer::globals::include_pathes_read )
-    {
-        $completefilenameref = installer::scriptitems::get_sourcepath_from_filename_and_includepath(\$filename, $includepatharrayref, 0);		
-    }
-    else
-    {
-        $completefilenameref = installer::scriptitems::get_sourcepath_from_filename_and_includepath_classic(\$filename, $includepatharrayref, 0);
-    }
-
-    if ($$completefilenameref eq "") { installer::exiter::exit_program("ERROR: Could not find download file $filename!", "put_banner_bmp_into_template"); }
-
-    if ( $^O =~ /cygwin/i ) { $$completefilenameref =~ s/\//\\/g; }
-
-    replace_one_variable($templatefile, "BANNERBMPPLACEHOLDER", $$completefilenameref);
-}
-
-##################################################################
-# Windows: Including the path to the welcome.bmp into nsi template 
-##################################################################
-
-sub put_welcome_bmp_into_template
-{
-    my ($templatefile, $includepatharrayref, $allvariables) = @_;
-
-    # my $filename = "downloadbitmap.bmp";
-    if ( ! $allvariables->{'DOWNLOADBITMAP'} ) { installer::exiter::exit_program("ERROR: DOWNLOADBITMAP not defined in product definition!", "put_welcome_bmp_into_template"); }
-    my $filename = $allvariables->{'DOWNLOADBITMAP'};
+    if ( ! $allvariables->{$var} ) { $var =~ s/_.*$//; } # _BR suffix ?
+    if ( ! $allvariables->{$var} ) { installer::exiter::exit_program("ERROR: $var not defined in product definition!", "substitute_path_into_template"); }
+    my $filename = $allvariables->{$var};
 
     my $completefilenameref = "";
 
@@ -1035,95 +993,24 @@ sub put_welcome_bmp_into_template
         $completefilenameref = installer::scriptitems::get_sourcepath_from_filename_and_includepath_classic(\$filename, $includepatharrayref, 0);
     }
 
-    if ($$completefilenameref eq "") { installer::exiter::exit_program("ERROR: Could not find download file $filename!", "put_welcome_bmp_into_template"); }
+    if ($$completefilenameref eq "") { installer::exiter::exit_program("ERROR: Could not find download file $filename!", "substitute_path_into_template"); }
 
     if ( $^O =~ /cygwin/i ) { $$completefilenameref =~ s/\//\\/g; }
 
-    replace_one_variable($templatefile, "WELCOMEBMPPLACEHOLDER", $$completefilenameref);
+    replace_one_variable($templatefile, $subst, $$completefilenameref);
 }
 
 ##################################################################
-# Windows: Including the path to the setup.ico into nsi template 
+# Windows: substitute a variable into the nsi template
 ##################################################################
-
-sub put_setup_ico_into_template
+sub substitute_variable_into_template($$$$)
 {
-    my ($templatefile, $includepatharrayref, $allvariables) = @_;
-
-    # my $filename = "downloadsetup.ico";
-    if ( ! $allvariables->{'DOWNLOADSETUPICO'} ) { installer::exiter::exit_program("ERROR: DOWNLOADSETUPICO not defined in product definition!", "put_setup_ico_into_template"); }
-    my $filename = $allvariables->{'DOWNLOADSETUPICO'};
-
-    my $completefilenameref = "";
-
-    if ( $installer::globals::include_pathes_read )
-    {
-        $completefilenameref = installer::scriptitems::get_sourcepath_from_filename_and_includepath(\$filename, $includepatharrayref, 0);
-    }
-    else
-    {
-        $completefilenameref = installer::scriptitems::get_sourcepath_from_filename_and_includepath_classic(\$filename, $includepatharrayref, 0);
-    }
+    my ($templatefile, $variableshashref, $varname, $subst) = @_;
 
-    if ($$completefilenameref eq "") { installer::exiter::exit_program("ERROR: Could not find download file $filename!", "put_setup_ico_into_template"); }
+    my $var = "";
+    if ( $variableshashref->{$varname} ) { $var = $variableshashref->{$varname}; }
 
-    if ( $^O =~ /cygwin/i ) { $$completefilenameref =~ s/\//\\/g; }
-
-    replace_one_variable($templatefile, "SETUPICOPLACEHOLDER", $$completefilenameref);
-}
-
-##################################################################
-# Windows: Including the publisher into nsi template 
-##################################################################
-
-sub put_publisher_into_template
-{
-    my ($templatefile) = @_;
-    
-    my $publisher = "Sun Microsystems, Inc.";
-
-    replace_one_variable($templatefile, "PUBLISHERPLACEHOLDER", $publisher);
-}
-
-##################################################################
-# Windows: Including the web site into nsi template 
-##################################################################
-
-sub put_website_into_template
-{
-    my ($templatefile) = @_;
-
-    my $website = "http\:\/\/www\.sun\.com\/staroffice";
-
-    replace_one_variable($templatefile, "WEBSITEPLACEHOLDER", $website);
-}
-
-##################################################################
-# Windows: Including the Java file name into nsi template 
-##################################################################
-
-sub put_javafilename_into_template
-{
-    my ($templatefile, $variableshashref) = @_;
-    
-    my $javaversion = "";
-    
-    if ( $variableshashref->{'WINDOWSJAVAFILENAME'} ) { $javaversion = $variableshashref->{'WINDOWSJAVAFILENAME'}; }
-    
-    replace_one_variable($templatefile, "WINDOWSJAVAFILENAMEPLACEHOLDER", $javaversion);
-}
-
-##################################################################
-# Windows: Including the product version into nsi template 
-##################################################################
-
-sub put_windows_productversion_into_template
-{
-    my ($templatefile, $variableshashref) = @_;
-    
-    my $productversion = $variableshashref->{'PRODUCTVERSION'};
-    
-    replace_one_variable($templatefile, "PRODUCTVERSIONPLACEHOLDER", $productversion);
+    replace_one_variable($templatefile, $subst, $var);
 }
 
 ##################################################################
@@ -1139,7 +1026,6 @@ sub put_windows_productpath_into_template
     if (length($locallangs) > $installer::globals::max_lang_length) { $locallangs = "multi lingual"; }
 
     if ( ! $installer::globals::languagepack ) { $productpath = $productpath . " (" . sprintf('%x', time()) . ")"; }
-    # if (( $installer::globals::languagepack ) && ( $installer::globals::unicodensis )) { $productpath = convert_textstring_to_utf16($productpath, $localnsisdir, "stringhelper.txt"); }
     
     replace_one_variable($templatefile, "PRODUCTPATHPLACEHOLDER", $productpath);
 }
@@ -1295,7 +1181,6 @@ sub nsis_language_converter
         my $infoline = "NSIS language_converter : Could not find nsis language for $language!\n";
         push( @installer::globals::logfileinfo, $infoline);
         $nsislanguage = "English";
-        # installer::exiter::exit_program("ERROR: Could not find nsis language for $language!", "nsis_language_converter");  
     }
 
     return $nsislanguage;
@@ -1524,8 +1409,6 @@ sub convert_utf16_to_utf8
     my $savfilename = $filename . "_before.utf16";
     installer::systemactions::copy_one_file($filename, $savfilename);
 
-#	open( IN, "<:utf16", $filename ) || installer::exiter::exit_program("ERROR: Cannot open file $filename for reading", "convert_utf16_to_utf8");
-#	open( IN, "<:para:crlf:uni", $filename ) || installer::exiter::exit_program("ERROR: Cannot open file $filename for reading", "convert_utf16_to_utf8");
     open( IN, "<:encoding(UTF16-LE)", $filename ) || installer::exiter::exit_program("ERROR: Cannot open file $filename for reading", "convert_utf16_to_utf8");
     while ( $line = <IN> ) {
         push @localfile, $line;
@@ -1750,12 +1633,6 @@ sub get_path_to_nsis_sdk
         $nsispath = $ENV{'NSISSDK_SOURCE'};	# overriding the NSIS SDK with NSISSDK_SOURCE
     }
 
-#	if( ($^O =~ /cygwin/i) and $nsispath =~ /\\/ ) {
-#		# We need a POSIX path for W32-4nt-cygwin-perl
-#		$nsispath =~ s/\\/\\\\/g;
-#		chomp( $nsispath = qx{cygpath -u "$nsispath"} );
-#	}
-
     if ( $nsispath eq "" )
     {
         installer::logger::print_message( "... no Environment variable \"SOLARROOT\", \"NSIS_PATH\" or \"NSISSDK_SOURCE\" found and NSIS not found in path!", "get_path_to_nsis_sdk");
@@ -1870,9 +1747,6 @@ sub remove_english_for_nsis_installer
 {
     my ($languagestringref, $languagesarrayref) = @_;
 
-    # $$languagestringref =~ s/en-US_//;
-    # shift(@{$languagesarrayref});
-
     @{$languagesarrayref} = ("en-US");	# only english for NSIS installer!
 }
 
@@ -2074,13 +1948,29 @@ sub create_download_sets
 
         # add product name into script template
         put_windows_productname_into_template($templatefile, $allvariableshashref);
-        put_banner_bmp_into_template($templatefile, $includepatharrayref, $allvariableshashref);
-        put_welcome_bmp_into_template($templatefile, $includepatharrayref, $allvariableshashref);
-        put_setup_ico_into_template($templatefile, $includepatharrayref, $allvariableshashref);
-        put_publisher_into_template($templatefile);
-        put_website_into_template($templatefile);
-        put_javafilename_into_template($templatefile, $allvariableshashref);
-        put_windows_productversion_into_template($templatefile, $allvariableshashref);
+        @path_substs = (
+            'DOWNLOADBANNER_BR' => 'BANNERBMPPLACEHOLDER_BR',
+            'DOWNLOADBITMAP_BR' => 'WELCOMEBMPPLACEHOLDER_BR',
+            'DOWNLOADBANNER' => 'BANNERBMPPLACEHOLDER',
+            'DOWNLOADBITMAP' => 'WELCOMEBMPPLACEHOLDER',
+            'DOWNLOADSETUPICO' => 'SETUPICOPLACEHOLDER'
+        );
+        while (@path_substs) {
+            my $var= shift @path_substs;
+            my $val = shift @path_substs;
+            substitute_path_into_template($templatefile, $includepatharrayref,
+                                          $allvariableshashref, $var, $val);
+        }
+        %var_substs = (
+            'OOOVENDOR' => 'PUBLISHERPLACEHOLDER',
+            'STARTCENTER_INFO_URL' => 'WEBSITEPLACEHOLDER',
+            'WINDOWSJAVAFILENAME' => 'WINDOWSJAVAFILENAMEPLACEHOLDER',
+            'PRODUCTVERSION' => 'PRODUCTVERSIONPLACEHOLDER'
+        );
+        for $var (keys %var_substs) {
+            substitute_variable_into_template($templatefile, $allvariableshashref,
+                                              $var, $var_substs{$var});
+        }
         put_windows_productpath_into_template($templatefile, $allvariableshashref, $languagestringref, $localnsisdir);
         put_outputfilename_into_template($templatefile, $downloadname);
         put_filelist_into_template($templatefile, $installationdir);
@@ -2150,9 +2040,6 @@ sub create_download_link_tree
                 push( @installer::globals::logfileinfo, $infoline);
 
                 create_link_tree($sourcedownloadfile, $destdownloadfilename, $versionstring);
-                # my $md5sumoutput = call_md5sum($downloadfile);
-                # my $md5sum = get_md5sum($md5sumoutput);
-                
             }
         }
         else
commit 95abe012a91e8137da321113420323533b66a10c
Author: Michael Meeks <michael.meeks at novell.com>
Date:   Mon Nov 29 20:04:18 2010 +0000

    make NSIS MUI even more verbose

diff --git a/solenv/bin/modules/installer/download.pm b/solenv/bin/modules/installer/download.pm
index 7626000..664f319 100644
--- a/solenv/bin/modules/installer/download.pm
+++ b/solenv/bin/modules/installer/download.pm
@@ -1781,7 +1781,7 @@ sub call_nsis
 
     if( $^O =~ /cygwin/i ) { $nsifile =~ s/\\/\//g;	}
 
-    my $systemcall = "$makensisexe $nsifile |";
+    my $systemcall = "$makensisexe /V4 /DMUI_VERBOSE=4 $nsifile |";
 
     my $infoline = "Systemcall: $systemcall\n";
     push( @installer::globals::logfileinfo, $infoline);


More information about the Libreoffice-commits mailing list