[Libreoffice-commits] .: Branch 'libreoffice-3-3' - solenv/bin
Fridrich Strba
fridrich at kemper.freedesktop.org
Fri Dec 17 14:33:28 PST 2010
solenv/bin/modules/installer/windows/createfolder.pm | 53 ++++++++++++++++++-
1 file changed, 52 insertions(+), 1 deletion(-)
New commits:
commit 5f169d3640b37e548e44f33b4318f46370f25cdf
Author: Petr Mladek <pmladek at novell.com>
Date: Fri Dec 17 23:29:37 2010 +0100
implement searching for helppack file
diff --git a/solenv/bin/modules/installer/windows/createfolder.pm b/solenv/bin/modules/installer/windows/createfolder.pm
index 261131d..f8d7600 100644
--- a/solenv/bin/modules/installer/windows/createfolder.pm
+++ b/solenv/bin/modules/installer/windows/createfolder.pm
@@ -75,6 +75,57 @@ sub get_languagepack_file
}
##############################################################
+# Searching the correct file for help pack directories.
+##############################################################
+
+sub get_helppack_file
+{
+ my ($filesref, $onedir) = @_;
+
+ my $language = $onedir->{'specificlanguage'};
+ my $foundfile = 0;
+ my $onefile = "";
+
+ for ( my $i = 0; $i <= $#{$filesref}; $i++ )
+ {
+ last if ($foundfile);
+
+ $onefile = ${$filesref}[$i];
+
+ my $styles = "";
+ if ( $onefile->{'Styles'} ) { $styles = $onefile->{'Styles'}; }
+
+ # we need a file with the HELPPACK flag
+ if (( $styles =~ /\bHELPPACK\b/ ) || ( $styles =~ /\bFORCEHELPPACK\b/ ))
+ {
+ # chect that the language is correct
+ if ($onefile->{'ismultilingual'};)
+ {
+ my $specificlanguage = "";
+ if ( $onefile->{'specificlanguage'} ) { $specificlanguage = $onefile->{'specificlanguage'}; }
+
+ for ( my $j = 0; $j <= $#{$languagesarrayref}; $j++ ) # iterating over all languages
+ {
+ my $onelanguage = ${$languagesarrayref}[$j];
+ my $locallang = $onelanguage;
+ $locallang =~ s/-/_/;
+
+ if ( $specificlanguage eq $onelanguage )
+ {
+ $foundfile = 1;
+ last;
+ }
+ }
+ }
+ }
+ }
+
+ if ( ! $foundfile ) { installer::exiter::exit_program("ERROR: No file with correct language found (language pack build)!", "get_languagepack_file"); }
+
+ return $onefile;
+}
+
+##############################################################
# Returning component for createfolder table.
##############################################################
@@ -96,7 +147,7 @@ sub get_createfolder_component
my $onefile = "";
if ( $installer::globals::languagepack ) { $onefile = get_languagepack_file($filesref, $onedir); }
- elsif ( $installer::globals::helppack ) { $onefile = installer::existence::get_specified_file($filesref, 'gid_File_Help_Help_Zip'); }
+ elsif ( $installer::globals::helppack ) { $onefile = get_helppack_file($filesref, $onedir); }
else { $onefile = installer::existence::get_specified_file($filesref, $globalfilegid); }
return $onefile->{'componentname'};
More information about the Libreoffice-commits
mailing list