diff options
-rw-r--r-- | perl-install/install_any.pm | 9 | ||||
-rw-r--r-- | perl-install/pkgs.pm | 2 |
2 files changed, 9 insertions, 2 deletions
diff --git a/perl-install/install_any.pm b/perl-install/install_any.pm index f4aee9518..f37d7006e 100644 --- a/perl-install/install_any.pm +++ b/perl-install/install_any.pm @@ -239,6 +239,13 @@ sub getFile { } } || errorOpeningFile($f); } + +sub getLocalFile { + my ($file) = @_; + my $F; + open($F, $file) ? $F : do { log::l("Can not open $file: $!"); undef }; +} + sub getAndSaveFile { my ($file, $local) = @_ == 1 ? ("install/stage2/live$_[0]", $_[0]) : @_; local $/ = \ (16 * 1024); @@ -603,7 +610,7 @@ sub load_rate_files { pkgs::read_rpmsrate( $o->{packages}, $o->{rpmsrate_flags_chosen}, - getFile(-e "/tmp/rpmsrate" ? "/tmp/rpmsrate" : "media/media_info/rpmsrate") + -e "/tmp/rpmsrate" ? getLocalFile("/tmp/rpmsrate") : getFile("media/media_info/rpmsrate") ); ($o->{compssUsers}, $o->{gtk_display_compssUsers}) = pkgs::readCompssUsers( -e '/tmp/compssUsers.pl' ? '/tmp/compssUsers.pl' : 'media/media_info/compssUsers.pl' diff --git a/perl-install/pkgs.pm b/perl-install/pkgs.pm index 2dfa0cf14..47b3633e6 100644 --- a/perl-install/pkgs.pm +++ b/perl-install/pkgs.pm @@ -661,7 +661,7 @@ sub read_rpmsrate { sub readCompssUsers { my ($file) = @_; - my $f = install_any::getFile($file) + my $f = -e $file ? install_any::getLocalFile($file) : install_any::getFile($file) or do { log::l("can not find $file: $!"); return (undef, undef) }; my ($compssUsers, $gtk_display_compssUsers) = eval join('', <$f>); if ($@) { |