From 68355635f23989f548a94a2f320374e4b4932bcb Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Mon, 31 Mar 2008 11:04:19 +0000 Subject: - diskdrake --fileshare: o do not ask to install nautilus-filesharing if already installed (#39544) the fix is to make ensure_is_installed behave like ensure_are_installed when no file is given --- perl-install/do_pkgs.pm | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'perl-install/do_pkgs.pm') diff --git a/perl-install/do_pkgs.pm b/perl-install/do_pkgs.pm index a6e4c4a26..bc2196c3a 100644 --- a/perl-install/do_pkgs.pm +++ b/perl-install/do_pkgs.pm @@ -12,14 +12,18 @@ use common; sub ensure_is_installed { my ($do, $pkg, $o_file, $b_auto) = @_; - if (! $o_file || ! -e "$::prefix$o_file") { + if ($o_file ? -e "$::prefix$o_file" : $do->is_installed($pkg)) { + return 1; + } + $do->in->ask_okcancel(N("Warning"), N("The package %s needs to be installed. Do you want to install it?", $pkg), 1) or return if !$b_auto && $do->in; + if (!$do->install($pkg)) { $do->in->ask_warn(N("Error"), N("Could not install the %s package!", $pkg)) if $do->in; return; } - } + if ($o_file && ! -e "$::prefix$o_file") { $do->in->ask_warn(N("Error"), N("Mandatory package %s is missing", $pkg)) if $do->in; return; -- cgit v1.2.1