summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorOlivier Thauvin <nanardon@mandriva.org>2006-08-24 16:08:01 +0000
committerOlivier Thauvin <nanardon@mandriva.org>2006-08-24 16:08:01 +0000
commit071b220b11859f11db8f51428ef906af5c17287f (patch)
tree231b935553bffb953aeecea23dfbeda4416663ca /lib
parent57410a78de825ad8f1d45a4a7a86735c1f72ce7d (diff)
downloadperl-MDV-Distribconf-071b220b11859f11db8f51428ef906af5c17287f.tar
perl-MDV-Distribconf-071b220b11859f11db8f51428ef906af5c17287f.tar.gz
perl-MDV-Distribconf-071b220b11859f11db8f51428ef906af5c17287f.tar.bz2
perl-MDV-Distribconf-071b220b11859f11db8f51428ef906af5c17287f.tar.xz
perl-MDV-Distribconf-071b220b11859f11db8f51428ef906af5c17287f.zip
- more know variables
- improve doc - minor fixes
Diffstat (limited to 'lib')
-rw-r--r--lib/MDV/Distribconf.pm14
-rw-r--r--lib/MDV/Distribconf/MediaCFG.pm64
2 files changed, 74 insertions, 4 deletions
diff --git a/lib/MDV/Distribconf.pm b/lib/MDV/Distribconf.pm
index 4111f98..e417cf6 100644
--- a/lib/MDV/Distribconf.pm
+++ b/lib/MDV/Distribconf.pm
@@ -434,15 +434,19 @@ sub getvalue {
/^synthesis$/ and $default = 'synthesis.' . lc($distrib->getvalue($media, 'hdlist', $level));
/^hdlist$/ and $default = 'hdlist_' . lc($distrib->getvalue($media, 'name', $level)) . '.cz';
/^pubkey$/ and $default = 'pubkey_' . lc($distrib->getvalue($media, 'name', $level));
- /^name$/ and $default = $media;
- $default =~ s![/ ]+!_!g;
+ /^name$/ and do {
+ $default = $media;
+ $default =~ s![/ ]+!_!g;
+ last;
+ };
/^path$/ and return $media;
/^root$/ and return $distrib->{root};
/^mediacfg_version$/ and
return $distrib->{cfg}->val('media_info', 'mediacfg_version') || 1;
/^VERSION$/ and do { $default = 'VERSION'; last };
/^product$/ and do { $default = 'Download'; last };
- /^MD5SUM$/ and do { $default = 'MD5SUM'; last };
+ /^(MD5SUM|depslist.ordered|compss|provides)$/
+ and do { $default = $_; last };
/^(?:tag|branch)$/ and do { $default = ''; last };
/^(?:media|info)dir$/ and do { $default = $distrib->{$var}; last };
}
@@ -465,7 +469,7 @@ sub getpath {
$var =~ /^(?:root|VERSION)$/ and return $val;
my $thispath = $var eq 'path' ? $distrib->{mediadir} : $distrib->{infodir};
if ($distrib->getvalue(undef, 'mediacfg_version') >= 2) {
- return $thispath . ($media ? '/' . $val : '');
+ return $thispath . '/' . $val;
} else {
return ($val =~ m!/! ? "" :
($var eq 'path' ? $distrib->{mediadir} : $distrib->{infodir} )
@@ -540,6 +544,8 @@ The code has been written by Olivier Thauvin <nanardon@mandriva.org> and is
currently maintained by Rafael Garcia-Suarez <rgarciasuarez@mandriva.com>.
Thanks to Sylvie Terjan <erinmargault@mandriva.org> for the spell checking.
+=head1 LICENSE AND COPYRIGHT
+
(c) 2005 Olivier Thauvin ; (c) 2005, 2006 Mandriva
This program is free software; you can redistribute it and/or modify
diff --git a/lib/MDV/Distribconf/MediaCFG.pm b/lib/MDV/Distribconf/MediaCFG.pm
index c1b33c6..249f6e5 100644
--- a/lib/MDV/Distribconf/MediaCFG.pm
+++ b/lib/MDV/Distribconf/MediaCFG.pm
@@ -101,6 +101,30 @@ The branch of the distribution.
=cut
+$value->{product} = { section => 'media_info' };
+
+=head3 product
+
+The name of the product, 'Download' by default
+
+=cut
+
+$value->{minor} = { section => 'media_info' };
+
+=head3 minor
+
+No documentation
+
+=cut
+
+$value->{subversion} = { section => 'media_info' };
+
+=head3 subversion
+
+No documentation
+
+=cut
+
=head2 MEDIA VALUES
=cut
@@ -194,6 +218,23 @@ The size of the media. The value is suffixed by the unit.
=cut
+$value->{suppl} = { };
+
+=head3 suppl
+
+The media is a supplementary media.
+
+=cut
+
+$value->{askmedia} = { };
+
+=head3 askmedia
+
+Tools should ask to the user if the media should be add or not to
+the configuration
+
+=cut
+
# valid_param($media, $var, $val)
#
# Return a list of errors (if any) about having such value in the config
@@ -228,3 +269,26 @@ sub _value_info {
__END__
+=head1 AUTHOR
+
+Olivier Thauvin <nanardon@mandriva.org>
+
+=head1 LICENSE AND COPYRIGHT
+
+(c) 2005 Olivier Thauvin ; (c) 2005, 2006 Mandriva
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+=cut