summaryrefslogtreecommitdiffstats
path: root/lib/MDV
diff options
context:
space:
mode:
authorOlivier Thauvin <nanardon@mandriva.org>2007-07-19 17:06:05 +0000
committerOlivier Thauvin <nanardon@mandriva.org>2007-07-19 17:06:05 +0000
commit2c6017d9464f2e10834d9316e381bdb5c351e15e (patch)
tree8c6045ea87dd371413689a51c7a8c849ae5707d1 /lib/MDV
parent4abe81dc4bbab339331c8952e121a95e03d556dc (diff)
downloadperl-MDV-Distribconf-2c6017d9464f2e10834d9316e381bdb5c351e15e.tar
perl-MDV-Distribconf-2c6017d9464f2e10834d9316e381bdb5c351e15e.tar.gz
perl-MDV-Distribconf-2c6017d9464f2e10834d9316e381bdb5c351e15e.tar.bz2
perl-MDV-Distribconf-2c6017d9464f2e10834d9316e381bdb5c351e15e.tar.xz
perl-MDV-Distribconf-2c6017d9464f2e10834d9316e381bdb5c351e15e.zip
- add getdpath and getfulldpath function
Diffstat (limited to 'lib/MDV')
-rw-r--r--lib/MDV/Distribconf.pm42
1 files changed, 42 insertions, 0 deletions
diff --git a/lib/MDV/Distribconf.pm b/lib/MDV/Distribconf.pm
index 8695c55..7f432b1 100644
--- a/lib/MDV/Distribconf.pm
+++ b/lib/MDV/Distribconf.pm
@@ -474,6 +474,10 @@ sub getvalue {
) : undef;
last;
};
+ /^rpmsrate$/ and do { $default = 'rpmsrate'; last; };
+ /^description$/ and do { $default = 'description'; last; };
+ /^provide$/ and do { $default = 'description'; last; };
+ /^depslist.ordered$/ and do { $default = 'description'; last; };
}
return $distrib->_expand($media, $distrib->{cfg}->val($media, $var, $default), $level);
}
@@ -552,6 +556,44 @@ sub getfullmediapath {
return $distrib->getpath(undef, 'root') . '/' . $path;
}
+=head2 $distrib->getdpath($media, $var)
+
+Does the same thing than getpath(), but the return always return the best for
+file having twice location (index).
+
+You may want to use this function to ensure you allways the good value.
+
+=cut
+
+sub getdpath {
+ my ($distrib, $media, $var) = @_;
+
+ if ($var =~ /^(hdlist|synthesis|pubkey|MD5SUM)$/) {
+ if ($distrib->{type} eq 'mandriva') {
+ return $distrib->getmediapath($media, $var);
+ } else {
+ return $distrib->getpath($media, $var);
+ }
+ } else {
+ return $distrib->getpath($media, $var);
+ }
+}
+
+=head2 $distrib->getfulldpath($media, $var)
+
+Does the same thing than getfullpath(), but the return always return the best
+for file having twice location (index).
+
+You may want to use this function to ensure you allways the good value.
+
+=cut
+
+sub getfulldpath {
+ my $distrib = shift;
+ my $path = $distrib->getdpath(@_) or return;
+ return $distrib->getpath(undef, 'root') . '/' . $path;
+}
+
1;