From e089d8aca1b128a8d656fd7d1393f7b67397efae Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Thu, 24 Mar 2005 10:17:10 +0000 Subject: network::drakfirewall::set_ports() doesn't *need* a $in anymore, and it doesn't die when no network card --- perl-install/network/drakfirewall.pm | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/perl-install/network/drakfirewall.pm b/perl-install/network/drakfirewall.pm index 554f6298f..fac1e7c10 100644 --- a/perl-install/network/drakfirewall.pm +++ b/perl-install/network/drakfirewall.pm @@ -126,10 +126,12 @@ sub get_ports() { } sub set_ports { - my ($in, $disabled, $ports) = @_; - my $shorewall = network::shorewall::read($in) || network::shorewall::default_interfaces($in) or die N("No network card"); + my ($do_pkgs, $disabled, $ports, $o_in) = @_; + + my $shorewall = network::shorewall::read($o_in) or return; + if (!$disabled || -x "$::prefix/sbin/shorewall") { - $in->do_pkgs->ensure_binary_is_installed('shorewall', 'shorewall', $::isInstall) or return; + $do_pkgs->ensure_binary_is_installed('shorewall', 'shorewall', $::isInstall) or return; $shorewall->{disabled} = $disabled; $shorewall->{ports} = $$ports; @@ -203,5 +205,13 @@ sub main { ($disabled, my $ports) = choose($in, $disabled, $servers, $unlisted) or return; - set_ports($in, $disabled, $ports); + set_ports($in->do_pkgs, $disabled, $ports, $in); +} + +sub main_auto_install { + my ($do_pkgs, $disabled) = @_; + + my $possible_servers = default_from_pkgs($do_pkgs); + + set_ports($do_pkgs, $disabled, to_ports($possible_servers, '')); } -- cgit v1.2.1