diff options
author | David Tardon <dtardon@redhat.com> | 2013-11-22 16:54:03 +0100 |
---|---|---|
committer | David Tardon <dtardon@redhat.com> | 2013-11-22 16:57:25 +0100 |
commit | edb0626a37f16b1bf705e8902f0c46ed46a6d0cd (patch) | |
tree | 19c83bd31086e2032e6913ee7a6b200cf92046c4 /solenv/bin/modules | |
parent | fe09dbf8cafdf7741ff8086b3683476b58df186c (diff) |
define module, not file
Change-Id: Ie828de19cc35228cd332ecbb5e11f2edb281bad8
Diffstat (limited to 'solenv/bin/modules')
-rw-r--r-- | solenv/bin/modules/installer/profiles.pm | 21 | ||||
-rw-r--r-- | solenv/bin/modules/installer/windows/createfolder.pm | 16 |
2 files changed, 26 insertions, 11 deletions
diff --git a/solenv/bin/modules/installer/profiles.pm b/solenv/bin/modules/installer/profiles.pm index e873a85b96ed..1a811d201fd6 100644 --- a/solenv/bin/modules/installer/profiles.pm +++ b/solenv/bin/modules/installer/profiles.pm @@ -75,17 +75,24 @@ sub add_profile_into_filelist my %profile = (); - # Taking the base data from the "gid_File_Lib_Oox" + # Taking the base data from a file in the root module - my $vclgid = "gid_File_Lib_Oox"; - if ( $allvariables->{'GLOBALFILEGID'} ) { $vclgid = $allvariables->{'GLOBALFILEGID'}; } - my ($vclfile) = grep {$_->{gid} eq $vclgid} @{$filesarrayref}; - if (! defined $vclfile) { - die "Could not find file $vclgid in list of files!"; + if ( ! $allvariableshashref->{'ROOTMODULEGID'} ) { installer::exiter::exit_program("ERROR: ROOTMODULEGID must be defined in list file!", "add_profile_into_filelist"); } + my $rootmodulegid = $allvariableshashref->{'ROOTMODULEGID'}; + my $rootfile; + foreach my $file (@{$filesarrayref}) { + if ($file->{'modules'} eq $rootmodulegid) + { + $rootfile = $file; + break; + } + } + if (! defined $rootfile) { + die "Could not find any file from module $rootmodulegid in list of files!"; } # copying all base data - installer::converter::copy_item_object($vclfile, \%profile); + installer::converter::copy_item_object($rootfile, \%profile); # and overriding all new values diff --git a/solenv/bin/modules/installer/windows/createfolder.pm b/solenv/bin/modules/installer/windows/createfolder.pm index 232415d3e7ca..02b29cd393bd 100644 --- a/solenv/bin/modules/installer/windows/createfolder.pm +++ b/solenv/bin/modules/installer/windows/createfolder.pm @@ -76,16 +76,24 @@ sub get_createfolder_component # Therefore they can only belong to the root module and # will be added to a component at the root module. # All directories will be added to the component - # containing the file $allvariableshashref->{'GLOBALFILEGID'} + # $allvariableshashref->{'ROOTMODULEGID'} - if ( ! $allvariableshashref->{'GLOBALFILEGID'} ) { installer::exiter::exit_program("ERROR: GLOBALFILEGID must be defined in list file!", "get_createfolder_component"); } + if ( ! $allvariableshashref->{'ROOTMODULEGID'} ) { installer::exiter::exit_program("ERROR: ROOTMODULEGID must be defined in list file!", "get_createfolder_component"); } - my $globalfilegid = $allvariableshashref->{'GLOBALFILEGID'}; + my $rootmodulegid = $allvariableshashref->{'ROOTMODULEGID'}; my $onefile; if ( $installer::globals::languagepack ) { $onefile = get_languagepack_file($filesref, $onedir); } elsif ( $installer::globals::helppack ) { ($onefile) = grep {$_->{gid} eq 'gid_File_Help_Common_Zip'} @{$filesref} } - else { ($onefile) = grep {$_->{gid} eq $globalfilegid} @{$filesref} } + else { + foreach my $file (@{$filesref}) { + if ($file->{'modules'} eq $rootmodulegid) + { + $onefile = $file; + break; + } + } + } if (! defined $onefile) { installer::exiter::exit_program("ERROR: Could not find file!", "get_createfolder_component"); |