diff options
author | Olivier Thauvin <nanardon@mandriva.org> | 2007-07-03 14:16:27 +0000 |
---|---|---|
committer | Olivier Thauvin <nanardon@mandriva.org> | 2007-07-03 14:16:27 +0000 |
commit | 4c5075db0eee4b3a49e43d2d35e116f10b47c4a3 (patch) | |
tree | a6e56df986c018a18eda51453c0e5e1333407bcc | |
parent | 6a13490ad603d37afdf555f43e3b4682dd623958 (diff) | |
download | perl-MDV-Distribconf-4c5075db0eee4b3a49e43d2d35e116f10b47c4a3.tar perl-MDV-Distribconf-4c5075db0eee4b3a49e43d2d35e116f10b47c4a3.tar.gz perl-MDV-Distribconf-4c5075db0eee4b3a49e43d2d35e116f10b47c4a3.tar.bz2 perl-MDV-Distribconf-4c5075db0eee4b3a49e43d2d35e116f10b47c4a3.tar.xz perl-MDV-Distribconf-4c5075db0eee4b3a49e43d2d35e116f10b47c4a3.zip |
- default vendor value should be evaluated from tree type
-rw-r--r-- | lib/MDV/Distribconf.pm | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/lib/MDV/Distribconf.pm b/lib/MDV/Distribconf.pm index c5193c1..16896ef 100644 --- a/lib/MDV/Distribconf.pm +++ b/lib/MDV/Distribconf.pm @@ -176,6 +176,7 @@ sub new { root => $path, infodir => '', mediadir => '', + type => '', # mdk vs mdv mediainfodir => '', cfg => new Config::IniFiles(-default => 'media_info', -allowcontinue => 1), }; @@ -220,13 +221,15 @@ sub loadtree { my ($distrib) = @_; if (-d "$distrib->{root}/media/media_info") { - $distrib->{infodir} = "media/media_info"; - $distrib->{mediadir} = "media"; + $distrib->{infodir} = 'media/media_info'; + $distrib->{mediadir} = 'media'; $distrib->{mediainfodir} = '/media_info'; + $distrib->{type} = 'mandriva'; } elsif (-d "$distrib->{root}/Mandrake/base") { - $distrib->{infodir} = "Mandrake/base"; - $distrib->{mediadir} = "Mandrake"; + $distrib->{infodir} = 'Mandrake/base'; + $distrib->{mediadir} = 'Mandrake'; $distrib->{mediainfodir} = ''; + $distrib->{type} = 'mandrake'; } else { return 0; } @@ -272,13 +275,15 @@ sub settree { $distrib->{$_} = $spec->{$_} || ''; } } elsif ($spec && $spec =~ /mandrake/i) { - $distrib->{infodir} = "Mandrake/base"; - $distrib->{mediadir} = "Mandrake"; + $distrib->{infodir} = 'Mandrake/base'; + $distrib->{mediadir} = 'Mandrake'; + $distrib->{type} = 'mandrake'; $distrib->{mediainfodir} = ''; } else { # finally it can be everything, we do not care - $distrib->{infodir} = "media/media_info"; - $distrib->{mediadir} = "media"; + $distrib->{infodir} = 'media/media_info'; + $distrib->{mediadir} = 'media'; $distrib->{mediainfodir} = '/media_info'; + $distrib->{type} = 'mandriva'; } } @@ -457,7 +462,7 @@ sub getvalue { /^(?:media|info)dir$/ and do { $default = $distrib->{$var}; last }; /^os$/ and do { $default = 'linux'; last; }; /^gnu$/ and do { $default = 1; last; }; - /^vendor$/ and do { $default = 'mandriva'; last; }; + /^vendor$/ and do { $default = $distrib->{type}; last; }; /^arch$/ and do { $default = `/bin/arch`; chomp($default); last; }; /^platform$/ and do { $default = sprintf('%s-%s-%s%s', |