Kaydet (Commit) 3c338f35 authored tarafından Oliver Bolte's avatar Oliver Bolte

INTEGRATION: CWS writerfilter (1.7.84); FILE MERGED

2005/11/14 16:37:02 is 1.7.84.3: #127314# new odt4word product
2005/11/11 16:24:56 is 1.7.84.2: #127329# setting path in odt4word
2005/11/11 16:23:08 is 1.7.84.1: #127329# setting path in odt4word
üst 221551fc
...@@ -4,9 +4,9 @@ ...@@ -4,9 +4,9 @@
# #
# $RCSfile: component.pm,v $ # $RCSfile: component.pm,v $
# #
# $Revision: 1.7 $ # $Revision: 1.8 $
# #
# last change: $Author: rt $ $Date: 2005-09-08 09:14:39 $ # last change: $Author: obo $ $Date: 2006-09-15 14:36:30 $
# #
# The Contents of this file are made available subject to # The Contents of this file are made available subject to
# the terms of GNU Lesser General Public License Version 2.1. # the terms of GNU Lesser General Public License Version 2.1.
...@@ -35,6 +35,8 @@ ...@@ -35,6 +35,8 @@
package installer::windows::component; package installer::windows::component;
use installer::converter;
use installer::existence;
use installer::exiter; use installer::exiter;
use installer::files; use installer::files;
use installer::globals; use installer::globals;
...@@ -244,6 +246,11 @@ sub get_component_condition ...@@ -244,6 +246,11 @@ sub get_component_condition
$condition = ""; # Always ? $condition = ""; # Always ?
if (exists($installer::globals::componentcondition{$componentname}))
{
$condition = $installer::globals::componentcondition{$componentname};
}
return $condition return $condition
} }
...@@ -348,4 +355,86 @@ sub create_component_table ...@@ -348,4 +355,86 @@ sub create_component_table
push(@installer::globals::logfileinfo, $infoline); push(@installer::globals::logfileinfo, $infoline);
} }
####################################################################################
# Returning a component for a scp module gid.
# Pairs are saved in the files collector.
####################################################################################
sub get_component_name_from_modulegid
{
my ($modulegid, $filesref) = @_;
my $componentname = "";
for ( my $i = 0; $i <= $#{$filesref}; $i++ )
{
my $onefile = ${$filesref}[$i];
if ( $onefile->{'modules'} )
{
my $filemodules = $onefile->{'modules'};
my $filemodulesarrayref = installer::converter::convert_stringlist_into_array_without_newline(\$filemodules, ",");
if (installer::existence::exists_in_array($modulegid, $filemodulesarrayref))
{
$componentname = $onefile->{'componentname'};
last;
}
}
}
return $componentname;
}
####################################################################################
# Updating the file Environm.idt dynamically
# Content:
# Environment Name Value Component_
####################################################################################
sub set_component_in_environment_table
{
my ($basedir, $filesref) = @_;
my $infoline = "";
my $environmentfilename = $basedir . $installer::globals::separator . "Environm.idt";
if ( -f $environmentfilename ) # only do something, if file exists
{
my $environmentfile = installer::files::read_file($environmentfilename);
for ( my $i = 3; $i <= $#{$environmentfile}; $i++ ) # starting in line 4 of Environm.idt
{
if ( ${$environmentfile}[$i] =~ /^\s*(.*?)\t(.*?)\t(.*?)\t(.*?)\s*$/ )
{
my $modulegid = $4; # in Environment table a scp module gid can be used as component replacement
my $componentname = get_component_name_from_modulegid($modulegid, $filesref);
if ( $componentname ) # only do something if a component could be found
{
$infoline = "Updated Environment table:\n";
push(@installer::globals::logfileinfo, $infoline);
$infoline = "Old line: ${$environmentfile}[$i]\n";
push(@installer::globals::logfileinfo, $infoline);
${$environmentfile}[$i] =~ s/$modulegid/$componentname/;
$infoline = "New line: ${$environmentfile}[$i]\n";
push(@installer::globals::logfileinfo, $infoline);
}
}
}
# Saving the file
installer::files::save_file($environmentfilename ,$environmentfile);
$infoline = "Updated idt file: $environmentfilename\n";
push(@installer::globals::logfileinfo, $infoline);
}
}
1; 1;
\ No newline at end of file
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