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

Petr Mladek pmladek at kemper.freedesktop.org
Thu Dec 16 03:39:56 PST 2010


 solenv/bin/modules/installer/epmfile.pm |   48 ++++++++++++++++++++++++--------
 1 file changed, 36 insertions(+), 12 deletions(-)

New commits:
commit 533671541b17edada500ccfc2208741a3ca18f9e
Author: Petr Mladek <pmladek at suse.cz>
Date:   Thu Dec 16 12:37:56 2010 +0100

    find LICENSE/README files for epm packaging
    
    Signed of by Fridrich Strba

diff --git a/solenv/bin/modules/installer/epmfile.pm b/solenv/bin/modules/installer/epmfile.pm
index 16e9deb..1260b74 100644
--- a/solenv/bin/modules/installer/epmfile.pm
+++ b/solenv/bin/modules/installer/epmfile.pm
@@ -322,7 +322,7 @@ sub create_epm_header
 
     my @epmheader = ();
     
-    my ($licensefilename, $readmefilename);
+    my ($licensefilename, $readmefilename, $readmefilenameen);
     
     my $foundlicensefile = 0;
     my $foundreadmefile = 0;
@@ -393,11 +393,13 @@ sub create_epm_header
     {
         $licensefilename = "license.txt";
         $readmefilename = "readme.txt";
+        $readmefilenameen = "readme_en-US.txt";
     }
     else
     {
         $licensefilename = "LICENSE";	
-        $readmefilename = "README";	
+        $readmefilename = "README";
+        $readmefilenameen = "README_en-US";
     }
     
     if (( $installer::globals::languagepack )	# in language packs the files LICENSE and README are removed, because they are not language specific
@@ -437,18 +439,24 @@ sub create_epm_header
             $license_in_package_defined = 1;
         }
     }	
-    # searching for and readme file
-    
-    for ( my $i = 0; $i <= $#{$filesinproduct}; $i++ )
+
+    # searching for and readme file;
+    # URE uses special README; others use README_en-US
+    # it does not matter which one is passed for epm if both are packaged
+    foreach my $possiblereadmefilename ($readmefilenameen, $readmefilename)
     {
-        my $onefile = ${$filesinproduct}[$i];
-        my $filename = $onefile->{'Name'};
-        if ( $filename eq $readmefilename )
+        last if ($foundreadmefile);
+        for ( my $i = 0; $i <= $#{$filesinproduct}; $i++ )
         {
-            $foundreadmefile = 1;
-            $line = "%readme" . " " . $onefile->{'sourcepath'} . "\n";
-            push(@epmheader, $line);
-            last;
+            my $onefile = ${$filesinproduct}[$i];
+            my $filename = $onefile->{'Name'};
+            if ( $filename eq $possiblereadmefilename )
+            {
+                $foundreadmefile = 1;
+                $line = "%readme" . " " . $onefile->{'sourcepath'} . "\n";
+                push(@epmheader, $line);
+                last;
+            }
         }
     }
 
@@ -507,6 +515,22 @@ sub create_epm_header
                 last;
             }
         }
+        if (!($foundlicensefile) && $installer::globals::languagepack)
+        {
+            # the license file need not be packaged more times in the langpacks
+            # they need to be installed in parallel with the main package anyway
+            # try to find the LICENSE file between all available files (not only between the packaged)
+            my $fileref = installer::scriptitems::get_sourcepath_from_filename_and_includepath(\$licensefilename, "" , 0);
+            if($$fileref ne "" )
+            {
+                $infoline = "Fallback to license file: \"$$fileref\"!\n";
+                push(@installer::globals::logfileinfo, $infoline);
+
+                $foundlicensefile = 1;
+                $line = "%license" . " " . $$fileref . "\n";
+                push(@epmheader, $line);
+            }
+        }
     }
 
     if (!($foundlicensefile))


More information about the Libreoffice-commits mailing list