Kaydet (Commit) 634e2da9 authored tarafından Petr Mladek's avatar Petr Mladek

find LICENSE/README files for epm packaging

Signed of by Fridrich Strba
üst 315a4e02
...@@ -322,7 +322,7 @@ sub create_epm_header ...@@ -322,7 +322,7 @@ sub create_epm_header
my @epmheader = (); my @epmheader = ();
my ($licensefilename, $readmefilename); my ($licensefilename, $readmefilename, $readmefilenameen);
my $foundlicensefile = 0; my $foundlicensefile = 0;
my $foundreadmefile = 0; my $foundreadmefile = 0;
...@@ -393,11 +393,13 @@ sub create_epm_header ...@@ -393,11 +393,13 @@ sub create_epm_header
{ {
$licensefilename = "license.txt"; $licensefilename = "license.txt";
$readmefilename = "readme.txt"; $readmefilename = "readme.txt";
$readmefilenameen = "readme_en-US.txt";
} }
else else
{ {
$licensefilename = "LICENSE"; $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 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 ...@@ -437,18 +439,24 @@ sub create_epm_header
$license_in_package_defined = 1; $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]; last if ($foundreadmefile);
my $filename = $onefile->{'Name'}; for ( my $i = 0; $i <= $#{$filesinproduct}; $i++ )
if ( $filename eq $readmefilename )
{ {
$foundreadmefile = 1; my $onefile = ${$filesinproduct}[$i];
$line = "%readme" . " " . $onefile->{'sourcepath'} . "\n"; my $filename = $onefile->{'Name'};
push(@epmheader, $line); if ( $filename eq $possiblereadmefilename )
last; {
$foundreadmefile = 1;
$line = "%readme" . " " . $onefile->{'sourcepath'} . "\n";
push(@epmheader, $line);
last;
}
} }
} }
...@@ -507,6 +515,22 @@ sub create_epm_header ...@@ -507,6 +515,22 @@ sub create_epm_header
last; 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)) if (!($foundlicensefile))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment