Author: af
Date: Tue Dec 10 08:50:51 2013
New Revision: 1549786

URL: http://svn.apache.org/r1549786
Log:
123531: Better support for multiple languages when creating patches.

Modified:
    openoffice/trunk/main/instsetoo_native/util/makefile.mk
    openoffice/trunk/main/solenv/bin/modules/installer/languages.pm
    openoffice/trunk/main/solenv/bin/modules/installer/windows/msiglobal.pm

Modified: openoffice/trunk/main/instsetoo_native/util/makefile.mk
URL: 
http://svn.apache.org/viewvc/openoffice/trunk/main/instsetoo_native/util/makefile.mk?rev=1549786&r1=1549785&r2=1549786&view=diff
==============================================================================
--- openoffice/trunk/main/instsetoo_native/util/makefile.mk (original)
+++ openoffice/trunk/main/instsetoo_native/util/makefile.mk Tue Dec 10 08:50:51 
2013
@@ -59,6 +59,17 @@ INSTALLDIR=$(OUT)
 
 .INCLUDE: target.mk
 
+.IF "$(FORCE2ARCHIVE)" == "TRUE"
+PKGFORMAT = archive
+.END
+.IF "$(MAKETARGETS:e)"!=""
+PKGFORMAT+=$(MAKETARGETS:e:s/.//)
+.ENDIF
+# PKGFORMAT may contain the standard package format twice at this time.
+# Provide its content with duplicates removed.
+PACKAGE_FORMATS=$(uniq $(PKGFORMAT))
+
+
 # The help target belongs after the inclusion of target.mk to not become the 
default target.
 help .PHONY :
        @echo "known targets:"
@@ -73,9 +84,9 @@ help .PHONY :
        @echo "    sdkoodev"
        @echo 
        @echo "experimental targets:"
-       @echo "    patch_create           create a patch for updating an 
installed office (Windows only)"
-       @echo "    patch_apply            apply a previously created patch"
-       @echo "    patch_update_releases_xml"
+       @echo "    patch-create           create a patch for updating an 
installed office (Windows only)"
+       @echo "    patch-apply            apply a previously created patch"
+       @echo "    patch-update-releases-xml"
        @echo 
        @echo "Most targets (all except aoo_srcrelease and updatepack) accept 
suffixes"
        @echo "    add _<language> to build a target for one language only"
@@ -110,13 +121,6 @@ ALLTAR : updatepack
 .ENDIF                 # "$(UPDATER)"=="" || "$(USE_PACKAGER)"==""
 .ENDIF                 # "$(GUI)"!="WNT" && "$(EPM)"=="NO" && 
"$(USE_PACKAGER)"==""
 
-.IF "$(FORCE2ARCHIVE)" == "TRUE"
-PKGFORMAT = archive
-.END
-
-.IF "$(MAKETARGETS:e)"!=""
-PKGFORMAT+=$(MAKETARGETS:e:s/.//)
-.ENDIF                 # "$(MAKETARGETS:e)"!=""
 
 # Independent of PKGFORMAT, always build a default-language openoffice product
 # also in archive format, so that tests that require an OOo installation (like
@@ -172,6 +176,7 @@ ooodevlanguagepack: $(foreach,i,$(alllan
 sdkoo: $(foreach,i,$(alllangiso) sdkoo_$i)
 
 sdkoodev: $(foreach,i,$(alllangiso) sdkoodev_$i)
+patch-create: $(foreach,i,$(alllangiso) patch-create_$i)
 
 MSIOFFICETEMPLATESOURCE=$(PRJ)$/inc_openoffice$/windows$/msi_templates
 MSILANGPACKTEMPLATESOURCE=$(PRJ)$/inc_ooolangpack$/windows$/msi_templates
@@ -219,6 +224,7 @@ $(foreach,i,$(alllangiso) ooolanguagepac
 $(foreach,i,$(alllangiso) ooodevlanguagepack_$i) : $$@{$(PKGFORMAT:^".")}
 $(foreach,i,$(alllangiso) sdkoo_$i) : $$@{$(PKGFORMAT:^".")}
 $(foreach,i,$(alllangiso) sdkoodev_$i) : $$@{$(PKGFORMAT:^".")}
+$(foreach,i,$(alllangiso) patch-create_$i) : $$@{$(PKGFORMAT:^".")}
 
 
 # This macro makes calling the make_installer.pl script a bit easier.
@@ -307,20 +313,25 @@ $(BIN)$/dev$/intro.zip : $(SOLARCOMMONPC
 
 
 .IF "$(OS)" == "WNT"
-patch_create .PHONY : $(PRJ)$/data
+$(foreach,P,$(PACKAGE_FORMATS) $(foreach,L,$(alllangiso) patch-create_$L.$P)) 
.PHONY :
+       @echo building $@
        perl -I $(SOLARENV)$/bin/modules $(SOLARENV)$/bin$/patch_tool.pl        
\
                create                                                          
\
                --product-name Apache_OpenOffice                                
\
                --output-path $(OUT)                                            
\
                --data-path $(PRJ)$/data                                        
\
-               --lst-file $(PRJ)$/util$/openoffice.lst
-patch_apply .PHONY :
+               --lst-file $(PRJ)$/util$/openoffice.lst                         
\
+               --language $(subst,$(@:s/_/ /:1)_, $(@:b))                      
\
+               --package-format $(@:e:s/.//)
+patch-apply .PHONY :
        perl -I $(SOLARENV)$/bin/modules $(SOLARENV)$/bin$/patch_tool.pl        
\
                apply                                                           
\
                --product-name Apache_OpenOffice                                
\
                --output-path $(OUT)                                            
\
-               --lst-file $(PRJ)$/util$/openoffice.lst
-patch_update_releases_xml .PHONY:
+               --lst-file $(PRJ)$/util$/openoffice.lst                         
\
+               --language en-US                                                
\
+               --package-format msi
+patch-update-releases-xml .PHONY:
        perl -I $(SOLARENV)$/bin/modules $(SOLARENV)$/bin$/patch_tool.pl        
\
                update-releases-xml                                             
\
                --product-name Apache_OpenOffice                                
\
@@ -331,7 +342,11 @@ patch_update_releases_xml .PHONY:
 $(PRJ)$/data :
        mkdir $@
 .ELSE
-patch .PHONY :
+$(foreach,P,$(PACKAGE_FORMATS) $(foreach,L,$(alllangiso) patch-create_$L.$P)) 
.PHONY :
+       @echo "patches can only be created on Windows at the moment"
+patch-apply .PHONY :
+       @echo "patches can only be created on Windows at the moment"
+patch-update-releases-xml .PHONY:
        @echo "patches can only be created on Windows at the moment"
 .ENDIF
 

Modified: openoffice/trunk/main/solenv/bin/modules/installer/languages.pm
URL: 
http://svn.apache.org/viewvc/openoffice/trunk/main/solenv/bin/modules/installer/languages.pm?rev=1549786&r1=1549785&r2=1549786&view=diff
==============================================================================
--- openoffice/trunk/main/solenv/bin/modules/installer/languages.pm (original)
+++ openoffice/trunk/main/solenv/bin/modules/installer/languages.pm Tue Dec 10 
08:50:51 2013
@@ -476,8 +476,19 @@ sub get_key_language ($)
 sub get_normalized_language ($)
 {
     my ($language) = @_;
-    
-    if ($language =~ /^.*?_(.*)$/)
+
+    if (ref($language) eq "ARRAY")
+    {
+        if (scalar @$language > 1 && $language->[0] eq "en-US")
+        {
+            return $language->[1];
+        }
+        else
+        {
+            return $language;
+        }
+    }
+    elsif ($language =~ /^.*?_(.*)$/)
     {
         return $1;
     }

Modified: 
openoffice/trunk/main/solenv/bin/modules/installer/windows/msiglobal.pm
URL: 
http://svn.apache.org/viewvc/openoffice/trunk/main/solenv/bin/modules/installer/windows/msiglobal.pm?rev=1549786&r1=1549785&r2=1549786&view=diff
==============================================================================
--- openoffice/trunk/main/solenv/bin/modules/installer/windows/msiglobal.pm 
(original)
+++ openoffice/trunk/main/solenv/bin/modules/installer/windows/msiglobal.pm Tue 
Dec 10 08:50:51 2013
@@ -1630,7 +1630,8 @@ sub get_source_codes ($)
     
     if ( ! defined $installer::globals::source_version)
     {
-        return;
+        $installer::logger::Lang->printf("no source version defined\n");
+        return (undef, undef);
     }
 
     my $onelanguage = installer::languages::get_key_language($languagesref);
@@ -1640,7 +1641,8 @@ sub get_source_codes ($)
         ->{$installer::globals::packageformat};
     if (defined $release_data)
     {
-        my $language_data = $release_data->{$onelanguage};
+        my $normalized_language = 
installer::languages::get_normalized_language($languagesref);
+        my $language_data = $release_data->{$normalized_language};
         if (defined $language_data)
         {
             $installer::logger::Lang->printf("source product code is %s\n", 
$language_data->{'product-code'});
@@ -1654,9 +1656,11 @@ sub get_source_codes ($)
         else
         {
             $installer::logger::Info->printf(
-                "Warning: can not access information about previous version %s 
and language %s\n",
+                "Warning: can not access information about previous version %s 
and language %s/%s/%s\n",
                 $installer::globals::source_version,
-                $onelanguage);
+                $onelanguage,
+                join(", ",@$languagesref),
+                $normalized_language);
             return (undef,undef);
         }
     }
@@ -1736,6 +1740,7 @@ sub set_global_code_variables ($$)
         # Just create two new uuids.
         $target_product_code = "{" . create_guid() . "}";
         $target_upgrade_code = "{" . create_guid() . "}";
+        $installer::logger::Lang->printf("there is no source version => 
created new guids\n");
     }
     
     $installer::globals::productcode = $target_product_code;


Reply via email to