summaryrefslogtreecommitdiff
path: root/solenv
diff options
context:
space:
mode:
authorPetr Mladek <pmladek@suse.cz>2010-12-16 12:37:56 +0100
committerPetr Mladek <pmladek@suse.cz>2010-12-16 12:37:56 +0100
commit634e2da96467f63339d19ba7fe3721a040295ed6 (patch)
tree3c0949ad886fc9c5d4fac6a75b2b79d929a554fd /solenv
parent315a4e026d3cd52de4ec9d22b699a1fa09cb3d03 (diff)
find LICENSE/README files for epm packaging
Signed of by Fridrich Strba
Diffstat (limited to 'solenv')
-rw-r--r--solenv/bin/modules/installer/epmfile.pm44
1 files changed, 34 insertions, 10 deletions
diff --git a/solenv/bin/modules/installer/epmfile.pm b/solenv/bin/modules/installer/epmfile.pm
index 769e02d6ed4f..5ae78343320c 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";
+ $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))