summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-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;