diff options
author | Tim Retout <tim@retout.co.uk> | 2012-02-17 22:29:26 +0000 |
---|---|---|
committer | Michael Meeks <michael.meeks@suse.com> | 2012-02-18 09:40:56 +0000 |
commit | fcac6ce7319af1006f65fcf2e84243c7c93458a4 (patch) | |
tree | 6f5ac5025579efc8d9ac6c7f2cede632fdc8c063 | |
parent | 6e07845a00bceaf66e95b97ea964b7868eff80c0 (diff) |
Remove installer::existence::get_specified_file_by_name.
-rw-r--r-- | solenv/bin/modules/installer/existence.pm | 32 | ||||
-rw-r--r-- | solenv/bin/modules/installer/worker.pm | 5 |
2 files changed, 4 insertions, 33 deletions
diff --git a/solenv/bin/modules/installer/existence.pm b/solenv/bin/modules/installer/existence.pm index 134637219126..95ba40dcfa66 100644 --- a/solenv/bin/modules/installer/existence.pm +++ b/solenv/bin/modules/installer/existence.pm @@ -63,36 +63,4 @@ sub get_specified_file return $onefile; } -##################################################################### -# Returning a specified file as base for a new file, -# defined by its "Name" -##################################################################### - -sub get_specified_file_by_name -{ - my ($filesarrayref, $searchname) = @_; - - my $foundfile = 0; - my $onefile; - - for ( my $i = 0; $i <= $#{$filesarrayref}; $i++ ) - { - $onefile = ${$filesarrayref}[$i]; - my $filename = $onefile->{'Name'}; - - if ( $filename eq $searchname ) - { - $foundfile = 1; - last; - } - } - - if (!($foundfile)) - { - installer::exiter::exit_program("ERROR: Could not find file $searchname in list of files!", "get_specified_file_by_name"); - } - - return $onefile; -} - 1; diff --git a/solenv/bin/modules/installer/worker.pm b/solenv/bin/modules/installer/worker.pm index be24ff7e776e..6592d08ef2ea 100644 --- a/solenv/bin/modules/installer/worker.pm +++ b/solenv/bin/modules/installer/worker.pm @@ -1403,7 +1403,10 @@ sub prepare_windows_patchfiles my $winpatchdirname = "winpatch"; my $winpatchdir = installer::systemactions::create_directories($winpatchdirname, $languagestringref); - my $patchlistfile = installer::existence::get_specified_file_by_name($filesref, $patchfilename); + my ($patchlistfile) = grep {$_->{Name} eq $patchfilename} @{$filesref}; + if (! defined $patchlistfile) { + installer::exiter::exit_program("ERROR: Could not find file $patchfilename in list of files!", "prepare_windows_patchfiles"); + } # reorganizing the patchfile content, sorting for directory to decrease the file size my $sorteddirectorylist = [ sort keys %patchfiledirectories ]; |