summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorOlivier Thauvin <nanardon@mandriva.org>2006-07-20 18:04:48 +0000
committerOlivier Thauvin <nanardon@mandriva.org>2006-07-20 18:04:48 +0000
commitae6a824cb69c59244204d5472287a6eb8de8cd85 (patch)
tree060647be8109a340ba46d7cd903a979dc89d4c1a /lib
parenta8650a4531259d8ce7a201f8f0f5c49cbb1cbae2 (diff)
downloadperl-MDV-Distribconf-ae6a824cb69c59244204d5472287a6eb8de8cd85.tar
perl-MDV-Distribconf-ae6a824cb69c59244204d5472287a6eb8de8cd85.tar.gz
perl-MDV-Distribconf-ae6a824cb69c59244204d5472287a6eb8de8cd85.tar.bz2
perl-MDV-Distribconf-ae6a824cb69c59244204d5472287a6eb8de8cd85.tar.xz
perl-MDV-Distribconf-ae6a824cb69c59244204d5472287a6eb8de8cd85.zip
- clean code
Diffstat (limited to 'lib')
-rw-r--r--lib/MDV/Distribconf.pm23
1 files changed, 13 insertions, 10 deletions
diff --git a/lib/MDV/Distribconf.pm b/lib/MDV/Distribconf.pm
index 8a3c2fd..48818b0 100644
--- a/lib/MDV/Distribconf.pm
+++ b/lib/MDV/Distribconf.pm
@@ -243,7 +243,7 @@ sub check_mediacfg_version {
# Otherwise the module can't properly handle it
return 0 if (mymediacfg_version() < $wanted_version);
- return 0 if ($wanted_version < $distrib->{cfg}->val('media_info', 'mediacfg_version', 1));
+ return 0 if ($wanted_version < $distrib->getvalue(undef, 'mediacfg_version'));
return 1
}
@@ -393,17 +393,18 @@ sub getvalue {
my $default = "";
for ($var) {
- /^synthesis$/ and $default = 'synthesis.' . lc($distrib->getvalue($media, 'hdlist'));
+ /^synthesis$/ and $default = 'synthesis.' . lc($distrib->getvalue($media, 'hdlist'));
/^hdlist$/ and $default = 'hdlist_' . lc($distrib->getvalue($media, 'name')) . '.cz';
/^pubkey$/ and $default = 'pubkey_' . lc($distrib->getvalue($media, 'name'));
/^name$/ and $default = $media;
$default =~ s![/ ]+!_!g;
- /^path$/ and return $media;
- /^root$/ and return $distrib->{root};
- /^VERSION$/ and do { $default = 'VERSION'; last };
- /^product$/ and do { $default = 'Download'; last };
- /^(?:tag|branch)$/ and do { $default = ''; last };
- /^(?:media|info)dir$/ and do { $default = $distrib->{$var}; last };
+ /^path$/ and return $media;
+ /^root$/ and return $distrib->{root};
+ /^mediacfg_version$/ and do { $default = '1'; last };
+ /^VERSION$/ and do { $default = 'VERSION'; last };
+ /^product$/ and do { $default = 'Download'; last };
+ /^(?:tag|branch)$/ and do { $default = ''; last };
+ /^(?:media|info)dir$/ and do { $default = $distrib->{$var}; last };
}
return $distrib->{cfg}->val($media, $var, $default);
}
@@ -424,8 +425,10 @@ sub getpath {
return
($distrib->getvalue(undef, 'mediacfg_version') >= 2 ?
$distrib->{mediadir} :
- ($val =~ m!/! ? "" : ($var eq 'path' ? $distrib->{mediadir} : $distrib->{infodir} ) . "/")) .
- $val;
+ ($val =~ m!/! ? '' :
+ ($var eq 'path' ? $distrib->{mediadir} : $distrib->{infodir})
+ )
+ ) . '/' . $val;
}
=head2 $distrib->getfullpath($media, $var)