From 055f126b9b89f608979ddaf49da72763ba4e1271 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Thu, 6 Dec 2001 22:49:35 +0000 Subject: ask before installing nfs-utils-clients or samba-client --- perl-install/network/nfs.pm | 11 +++++++++-- perl-install/network/smb.pm | 14 +++++++++++--- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/perl-install/network/nfs.pm b/perl-install/network/nfs.pm index f4a153665..dd841c5bf 100644 --- a/perl-install/network/nfs.pm +++ b/perl-install/network/nfs.pm @@ -7,9 +7,16 @@ use log; sub check { my ($in) = @_; + my $pkg = 'nfs-utils-clients'; my $f = '/usr/sbin/showmount'; - -e $f or $in->do_pkgs->install('nfs-utils-clients'); - -e $f or $in->ask_warn('', "Mandatory package nfs-utils-clients is missing"), return; + if (! -e $f) { + $in->ask_okcancel('', _("The package %s needs to be installed. Do you want to install it?", $pkg), 1) or return; + $in->do_pkgs->install($pkg); + } + if (! -e $f) { + $in->ask_warn('', _("Mandatory package %s is missing", $pkg)); + return; + } 1; } diff --git a/perl-install/network/smb.pm b/perl-install/network/smb.pm index 02c107bd1..350399797 100644 --- a/perl-install/network/smb.pm +++ b/perl-install/network/smb.pm @@ -3,15 +3,23 @@ package network::smb; use common; use network::network; + sub check { my ($in) = @_; + + my $pkg = 'samba-client'; my $f = '/usr/bin/nmblookup'; - -e $f or $in->do_pkgs->install('samba-client'); - -e $f or $in->ask_warn('', "Mandatory package samba-client is missing"), return; + if (! -e $f) { + $in->ask_okcancel('', _("The package %s needs to be installed. Do you want to install it?", $pkg), 1) or return; + $in->do_pkgs->install($pkg); + } + if (! -e $f) { + $in->ask_warn('', _("Mandatory package %s is missing", $pkg)); + return; + } 1; } - sub find_servers() { my (undef, @l) = `nmblookup "*"`; s/\s.*\n// foreach @l; -- cgit v1.2.1