summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorThierry Vignaud <tvignaud@mandriva.org>2004-01-22 20:24:49 +0000
committerThierry Vignaud <tvignaud@mandriva.org>2004-01-22 20:24:49 +0000
commitc39ce7aa14f2424c874cc58b5ce5249a05fabe66 (patch)
tree8893b894f4ac7fc7b2fe4dc116654b3830e88668 /common
parent568cc7c168e09ca61e6a6652ad0ab597fa5b6421 (diff)
downloaddrakwizard-c39ce7aa14f2424c874cc58b5ce5249a05fabe66.tar
drakwizard-c39ce7aa14f2424c874cc58b5ce5249a05fabe66.tar.gz
drakwizard-c39ce7aa14f2424c874cc58b5ce5249a05fabe66.tar.bz2
drakwizard-c39ce7aa14f2424c874cc58b5ce5249a05fabe66.tar.xz
drakwizard-c39ce7aa14f2424c874cc58b5ce5249a05fabe66.zip
perl_checker fixes
Diffstat (limited to 'common')
-rw-r--r--common/IFCFG.pm20
-rw-r--r--common/Varspaceval.pm10
-rw-r--r--common/Wizcommon.pm2
3 files changed, 13 insertions, 19 deletions
diff --git a/common/IFCFG.pm b/common/IFCFG.pm
index 24441494..f6d793e6 100644
--- a/common/IFCFG.pm
+++ b/common/IFCFG.pm
@@ -34,15 +34,14 @@ sub new {
my $ifconfig = `LC_ALL=C /sbin/ifconfig -a`;
my $device = 'NONE';
- my @interfaces;
foreach (split('\n', $ifconfig)) {
- my ($temp) = /(^eth[0-9]*:?[0-9]*).*/;
+ my ($temp) = /(^eth[0-9]*:?[0-9]*)/;
$device = $temp if defined $temp;
- my ($ip, $bcast, $netmask) = /\s*inet addr:([0-9\.]*)\s*Bcast:([0-9\.]*)\s*Mask:([0-9\.]*).*/;
+ my ($ip, $bcast, $netmask) = /\s*inet addr:([0-9\.]*)\s*Bcast:([0-9\.]*)\s*Mask:([0-9\.]*)/;
if (defined $ip && defined $bcast && defined $netmask) {
- $self->{itf}{$device} = {IPADDR => $ip, BROADCAST => $bcast, NETMASK => $netmask};
+ $self->{itf}{$device} = { IPADDR => $ip, BROADCAST => $bcast, NETMASK => $netmask };
my %conf = getVarsFromSh("/etc/sysconfig/network-scripts/ifcfg-$device");
- $self->{itf}{$device}{$_} = $conf{$_} foreach ('BOOTPROTO');
+ $self->{itf}{$device}{$_} = $conf{$_} foreach 'BOOTPROTO';
}
}
%{$self->{network}} = getVarsFromSh("/etc/sysconfig/network");
@@ -57,8 +56,7 @@ sub new {
}
sub is_dhcp {
- my $self = shift;
- my ($itf) = @_;
+ my ($self, $itf) = @_;
$itf ||= default_itf();
$self->{itf}{$itf}{BOOTPROTO} eq 'dhcp';
@@ -70,17 +68,15 @@ sub default_itf {
}
sub itf_get {
- my $self = shift;
- my ($key, $itf) = @_;
+ my ($self, $key, $itf) = @_;
- $itf ||= default_itf;
+ $itf ||= default_itf();
exists $self->{itf}{$itf}{$key} or print "ERROR: no $key field in $itf hash\n";
$self->{itf}{$itf}{$key}
}
sub network_get {
- my $self = shift;
- my ($key) = @_;
+ my ($self, $key) = @_;
exists $self->{network}{$key} or print "ERROR: no $key field in network hash\n";
$self->{network}{$key}
diff --git a/common/Varspaceval.pm b/common/Varspaceval.pm
index 3f35a992..9e996368 100644
--- a/common/Varspaceval.pm
+++ b/common/Varspaceval.pm
@@ -4,7 +4,7 @@
#
# Author: Philippe Hetroy, phetroy@mandrakesoft.com
#
-# $Id: Varspaceval.pm,v 1.4 2004-01-20 11:29:39 tvignaud Exp $
+# $Id: Varspaceval.pm,v 1.5 2004-01-22 20:24:48 tvignaud Exp $
# Module for loding and committing informations in a VAR = value file type
package MDK::Wizard::Varspaceval;
@@ -16,8 +16,7 @@ use Data::Dumper;
# Return a hash containg the key and the value
# ATTENTION : in the conf file, an empty value is returnes as a spaced value (mandatory because of XML compatibility)
sub get {
- my $self = shift;
- my $file = shift;
+ my ($_self, $file) = @_;
my %l;
local *F; open F, $file or return;
local $_;
@@ -43,8 +42,7 @@ sub get {
# Commits changes in conf files and ifconfig
sub commit {
- my $self = shift;
- my ($file, $hash) = @_;
+ my ($_self, $file, $hash) = @_;
local *F;
my $output = "";
@@ -58,7 +56,7 @@ sub commit {
$output .= $_;
next;
};
- next if (!exists $hash->{$key}); #Elt has been removed
+ next if !exists $hash->{$key}; #Elt has been removed
no warnings;
$val = $hash->{$key};
delete $hash->{$key};
diff --git a/common/Wizcommon.pm b/common/Wizcommon.pm
index b06838eb..a7c7793d 100644
--- a/common/Wizcommon.pm
+++ b/common/Wizcommon.pm
@@ -30,7 +30,7 @@ sub check_dhcp {
sub new {
my ($class, $_conf) = @_;
- $net = new IFCFG;
+ $net = new MDK::Wizard::IFCFG;
bless {
net => $net,
}, $class;