summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--perl-install/NEWS2
-rw-r--r--perl-install/do_pkgs.pm12
2 files changed, 13 insertions, 1 deletions
diff --git a/perl-install/NEWS b/perl-install/NEWS
index 87a7ef82b..c8de3696c 100644
--- a/perl-install/NEWS
+++ b/perl-install/NEWS
@@ -1,3 +1,5 @@
+- do_pkgs:
+ o fix a warning in mousedrake
- drakclock:
o fix crash on clicking "Cancel" after TZ selection (mga#13534)
o fix loosing TZ choice when canceling TZ selection (mga#13534)
diff --git a/perl-install/do_pkgs.pm b/perl-install/do_pkgs.pm
index 5ca4b24fc..8b56be26c 100644
--- a/perl-install/do_pkgs.pm
+++ b/perl-install/do_pkgs.pm
@@ -111,6 +111,16 @@ sub ensure_binary_is_installed {
1;
}
+sub _find_file {
+ my ($file) = @_;
+ if ($file =~ m!/!) {
+ -e "$::prefix$file";
+ } else {
+ # assume it's a binary to search in $PATH:
+ whereis_binary($file, $prefix);
+ }
+}
+
=item ensure_files_are_installed($do, $pkgs, $b_auto)
Takes a list of [ "package", "file" ] and installs package if file is not there.
@@ -121,7 +131,7 @@ If $b_auto is set, (g)urpmi will not ask any questions.
sub ensure_files_are_installed {
my ($do, $pkgs, $b_auto) = @_;
- my @not_installed = map { my ($package, $file) = @$_; if_(!whereis_binary($file, $::prefix), $package) } @$pkgs;
+ my @not_installed = map { my ($package, $file) = @$_; if_(!_find_file($file), $package) } @$pkgs;
return 1 if !@not_installed;
$do->in->ask_okcancel(N("Warning"), N("The following packages need to be installed:\n") . join(', ', @not_installed), 1)