summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.com>2008-11-24 17:26:06 +0000
committerOlivier Blin <oblin@mandriva.com>2008-11-24 17:26:06 +0000
commit804dc1d466391a09ab9c34de091cb8a49b0cd1fe (patch)
tree45f69270a4f6ce308f653f8dd9c60eda4549361b
parent7125fa455d365535c683966f1a5d27276da73b21 (diff)
downloaddrakx-net-804dc1d466391a09ab9c34de091cb8a49b0cd1fe.tar
drakx-net-804dc1d466391a09ab9c34de091cb8a49b0cd1fe.tar.gz
drakx-net-804dc1d466391a09ab9c34de091cb8a49b0cd1fe.tar.bz2
drakx-net-804dc1d466391a09ab9c34de091cb8a49b0cd1fe.tar.xz
drakx-net-804dc1d466391a09ab9c34de091cb8a49b0cd1fe.zip
rewrite package selection to avoid dereferencing empty ref
-rw-r--r--lib/network/connection/xdsl.pm11
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/network/connection/xdsl.pm b/lib/network/connection/xdsl.pm
index f5ca5b9..7c88dff 100644
--- a/lib/network/connection/xdsl.pm
+++ b/lib/network/connection/xdsl.pm
@@ -338,15 +338,16 @@ sub unload_connection {
sub install_packages {
my ($self, $in) = @_;
- my $packages = {
+ my $per_type_packages = {
pppoa => [ qw(ppp-pppoatm) ],
pppoe => [ qw(rp-pppoe) ],
pptp => [ qw(pptp-linux) ],
capi => [ qw(ppp) ],
- }->{$self->{protocol}};
- push @$packages, 'linux-atm' if $self->uses_atm_arp || $self->uses_atm_bridging;
- if ($packages && !$in->do_pkgs->install(@$packages)) {
- $in->ask_warn(N("Error"), N("Could not install the packages (%s)!", @$packages));
+ };
+ my @packages = @{$per_type_packages->{$self->{protocol}} || []};
+ push @packages, 'linux-atm' if $self->uses_atm_arp || $self->uses_atm_bridging;
+ if (@packages && !$in->do_pkgs->install(@packages)) {
+ $in->ask_warn(N("Error"), N("Could not install the packages (%s)!", @packages));
return;
}
if ($self->{protocol} eq 'capi') {