summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2004-05-27 15:01:49 +0000
committerPascal Rigaux <pixel@mandriva.com>2004-05-27 15:01:49 +0000
commitb48362ee1c2dd493dd6482125f73508684449695 (patch)
tree0fdb22df25e36c987cd3fbefedb64106c8da5991
parent755b1ba0fa1d2aa60df68a60034b6976643fc782 (diff)
downloaddrakx-b48362ee1c2dd493dd6482125f73508684449695.tar
drakx-b48362ee1c2dd493dd6482125f73508684449695.tar.gz
drakx-b48362ee1c2dd493dd6482125f73508684449695.tar.bz2
drakx-b48362ee1c2dd493dd6482125f73508684449695.tar.xz
drakx-b48362ee1c2dd493dd6482125f73508684449695.zip
instead of removing package nfs-utils or samba-server (when "diskdrake --fileshare" disables a export kind) (bugzilla #9804)
-rw-r--r--perl-install/any.pm12
1 files changed, 7 insertions, 5 deletions
diff --git a/perl-install/any.pm b/perl-install/any.pm
index 4abda68be..0921ec652 100644
--- a/perl-install/any.pm
+++ b/perl-install/any.pm
@@ -844,22 +844,24 @@ Allowing this will permit users to simply click on \"Share\" in konqueror and na
my $custom = $r eq $l[2];
if ($r ne $l[0]) {
#- verify we can export in $type
- my %type2file = (nfs => [ 'nfs-utils', '/etc/init.d/nfs' ], smb => [ 'samba-server', '/etc/init.d/smb' ]);
+ my %type2service = (nfs => [ 'nfs-utils', 'nfs' ], smb => [ 'samba-server', 'smb' ]);
my %l;
if ($type) {
%l = ($type => 1);
} else {
- %l = map_each { $::a => -e $::b->[1] } %type2file;
+ %l = map_each { $::a => -e $::b->[1] } %type2service;
$in->ask_from('', N("You can export using NFS or Samba. Please select which you'd like to use."),
[ map { { text => $_, val => \$l{$_}, type => 'bool' } } keys %l ]) or return;
}
foreach (keys %l) {
- my ($pkg, $file) = @{$type2file{$_}} or die "unknown type $_\n";
+ my ($pkg, $service) = @{$type2service{$_}} or die "unknown type $_\n";
+ my $file = "/etc/init.d/$service";
+ require services;
if ($l{$_}) {
$in->do_pkgs->ensure_is_installed($pkg, $file) or return;
+ services::start($service);
} elsif (-e $file) {
- $in->ask_okcancel('', N("The package %s is going to be removed.", $pkg), 1) or return;
- $in->do_pkgs->remove($pkg);
+ services::stop($service);
}
}
}