summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorOlivier Thauvin <nanardon@mandriva.org>2006-06-09 21:20:47 +0000
committerOlivier Thauvin <nanardon@mandriva.org>2006-06-09 21:20:47 +0000
commit39cbed22c071aea381101a9612485118692144d0 (patch)
tree56a541327af99f9d09179b3267e76994d7183ee1 /lib
parentb3fad5d69e480031e0fcd7eba8d3a926287696cc (diff)
downloadperl-MDV-Distribconf-39cbed22c071aea381101a9612485118692144d0.tar
perl-MDV-Distribconf-39cbed22c071aea381101a9612485118692144d0.tar.gz
perl-MDV-Distribconf-39cbed22c071aea381101a9612485118692144d0.tar.bz2
perl-MDV-Distribconf-39cbed22c071aea381101a9612485118692144d0.tar.xz
perl-MDV-Distribconf-39cbed22c071aea381101a9612485118692144d0.zip
- add settree() function
Diffstat (limited to 'lib')
-rw-r--r--lib/MDV/Distribconf.pm29
1 files changed, 29 insertions, 0 deletions
diff --git a/lib/MDV/Distribconf.pm b/lib/MDV/Distribconf.pm
index 0779db0..ecb58fb 100644
--- a/lib/MDV/Distribconf.pm
+++ b/lib/MDV/Distribconf.pm
@@ -219,6 +219,35 @@ sub loadtree {
return 1;
}
+=head2 $distrib->settree($spec)
+
+Virtual set the internal structure of the distrib.
+
+$spec can be 'mandrake' or 'mandriva' to automatically load a know structure
+(old and new fascion, or a hashref:
+
+ mediadir => 'media',
+ infodir => 'media/media_info',
+
+=cut
+
+sub settree {
+ my ($distrib, $spec) = @_;
+
+ if (ref($spec) eq 'HASH') {
+ foreach (qw(infodir mediadir)) {
+ $distrib->{$_} = $spec->{$_} || '';
+ }
+ } elsif ($spec && $spec =~ /mandrake/i) {
+ $distrib->{infodir} = "Mandrake/base";
+ $distrib->{mediadir} = "Mandrake";
+ } else { # finally it can be everything, we do not care
+ $distrib->{infodir} = "media/media_info";
+ $distrib->{mediadir} = "media";
+ }
+}
+
+
=head2 $distrib->parse_hdlists($hdlists)
Reads the F<hdlists> file whose path is given by the parameter $hdlist,