summaryrefslogtreecommitdiffstats
path: root/perl-install/network
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2002-11-06 17:38:26 +0000
committerPascal Rigaux <pixel@mandriva.com>2002-11-06 17:38:26 +0000
commitb8a25c88bba7e597dd0c148e15693672d2a30f85 (patch)
tree9c4922a45aa7ae98e414169afa898e4b19593a13 /perl-install/network
parent922d528b7664b8b885f596055bd25232f3df32a7 (diff)
downloaddrakx-b8a25c88bba7e597dd0c148e15693672d2a30f85.tar
drakx-b8a25c88bba7e597dd0c148e15693672d2a30f85.tar.gz
drakx-b8a25c88bba7e597dd0c148e15693672d2a30f85.tar.bz2
drakx-b8a25c88bba7e597dd0c148e15693672d2a30f85.tar.xz
drakx-b8a25c88bba7e597dd0c148e15693672d2a30f85.zip
replace complex "unless"s with "if"s
Diffstat (limited to 'perl-install/network')
-rw-r--r--perl-install/network/isdn.pm2
-rw-r--r--perl-install/network/netconnect.pm8
-rw-r--r--perl-install/network/network.pm4
3 files changed, 7 insertions, 7 deletions
diff --git a/perl-install/network/isdn.pm b/perl-install/network/isdn.pm
index cd084bb2a..029f75bcf 100644
--- a/perl-install/network/isdn.pm
+++ b/perl-install/network/isdn.pm
@@ -277,7 +277,7 @@ sub isdn_get_list {
sub isdn_get_info {
my ($desc) = @_;
foreach (@isdndata) {
- return $_ if ($_->{description} eq $desc);
+ return $_ if $_->{description} eq $desc;
}
}
diff --git a/perl-install/network/netconnect.pm b/perl-install/network/netconnect.pm
index f515d85ef..592092a06 100644
--- a/perl-install/network/netconnect.pm
+++ b/perl-install/network/netconnect.pm
@@ -46,10 +46,10 @@ sub intro {
translate($text),
sub { $_[0]{description} },
\@l);
- run_program::rooted($prefix, $connect_prog) if ($e->{c}==1);
- run_program::rooted($prefix, $disconnect_file) if ($e->{c}==2);
- main($prefix, $netcnx, $netc, $mouse, $in, $intf, 0, 0) if ($e->{c}==3);
- $in->exit(0) if ($e->{c}==4);
+ run_program::rooted($prefix, $connect_prog) if $e->{c}==1;
+ run_program::rooted($prefix, $disconnect_file) if $e->{c}==2;
+ main($prefix, $netcnx, $netc, $mouse, $in, $intf, 0, 0) if $e->{c}==3;
+ $in->exit(0) if $e->{c}==4;
} else {
main($prefix, $netcnx, $netc, $mouse, $in, $intf, 0, 0);
}
diff --git a/perl-install/network/network.pm b/perl-install/network/network.pm
index 4c92ead01..ed5c7f0f5 100644
--- a/perl-install/network/network.pm
+++ b/perl-install/network/network.pm
@@ -84,7 +84,7 @@ sub write_resolv_conf {
#- get the list of used dns.
my %used_dns; @used_dns{$netc->{dnsServer}, $netc->{dnsServer2}, $netc->{dnsServer3}} = (1, 2, 3);
- unless ($netc->{DOMAINNAME} || $netc->{DOMAINNAME2} || keys %used_dns > 0) {
+ if (!$netc->{DOMAINNAME} && !$netc->{DOMAINNAME2} && !%used_dns) {
unlink($file);
log::l("neither domain name nor dns server are configured");
return 0;
@@ -107,7 +107,7 @@ sub write_resolv_conf {
unlink $file; #- workaround situation when /etc/resolv.conf is an absolute link to /etc/ppp/resolv.conf or whatever
open F, ">$file" or die "cannot write $file: $!";
print F "# search $_\n" foreach grep { $_ ne "$netc->{DOMAINNAME} $netc->{DOMAINNAME2}" } sort { $search{$a} <=> $search{$b} } keys %search;
- print F "search $netc->{DOMAINNAME} $netc->{DOMAINNAME2}\n" if ($netc->{DOMAINNAME} || $netc->{DOMAINNAME2});
+ print F "search $netc->{DOMAINNAME} $netc->{DOMAINNAME2}\n" if $netc->{DOMAINNAME} || $netc->{DOMAINNAME2};
#- print F "$options\n\n";
print F "# nameserver $_\n" foreach grep { ! exists $used_dns{$_} } sort { $dns{$a} <=> $dns{$b} } keys %dns;
print F "nameserver $_\n" foreach sort { $used_dns{$a} <=> $used_dns{$b} } grep { $_ } keys %used_dns;