diff options
author | Rafael Garcia-Suarez <rgarciasuarez@mandriva.org> | 2005-09-29 14:14:52 +0000 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@mandriva.org> | 2005-09-29 14:14:52 +0000 |
commit | 64cdae33b544bbbec20341af925371c693638637 (patch) | |
tree | e45a248a50f5f69b7dd21b0d4a3a20883ad1ffb7 /Distribconf.pm | |
parent | 5421c66c4a2720baa6110d283854570d77043a03 (diff) | |
download | rpmtools-64cdae33b544bbbec20341af925371c693638637.tar rpmtools-64cdae33b544bbbec20341af925371c693638637.tar.gz rpmtools-64cdae33b544bbbec20341af925371c693638637.tar.bz2 rpmtools-64cdae33b544bbbec20341af925371c693638637.tar.xz rpmtools-64cdae33b544bbbec20341af925371c693638637.zip |
Avoid uninitialized warnings. Licensing terms. TODO and XXX notations.
Diffstat (limited to 'Distribconf.pm')
-rw-r--r-- | Distribconf.pm | 49 |
1 files changed, 25 insertions, 24 deletions
diff --git a/Distribconf.pm b/Distribconf.pm index 98f5f39..0e269ed 100644 --- a/Distribconf.pm +++ b/Distribconf.pm @@ -1,19 +1,3 @@ -##- Nanar <nanardon@mandriva.org> -##- -##- 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. - package Distribconf; (our $VERSION) = q$Id$ =~ /(\d+\.\d+)/; @@ -181,14 +165,12 @@ directory of the tree. sub new { my ($class, $path) = @_; - - my $distrib = { - root => $path, - medium => {}, - cfg => new Config::IniFiles( -default => 'media_info', -allowcontinue => 1), - }; - - bless($distrib, $class); + bless { + root => $path, + infodir => '', + mediadir => '', + cfg => new Config::IniFiles(-default => 'media_info', -allowcontinue => 1), + }, $class; } =head2 $distrib->load() @@ -204,6 +186,8 @@ See also L<loadtree>, L<parse_hdlists> and L<parse_mediacfg>. =cut +# TODO return 0 on error like everyone else does + sub load { my ($distrib) = @_; $distrib->loadtree() or return 1; @@ -291,6 +275,7 @@ sub parse_version { my $l = <$h_ver>; close $h_ver; chomp $l; + # XXX heuristics ahead. This breaks regularly. my ($version, $branch, $product, $arch) = $l =~ /^(?:mandrake|mandriva) ?linux\s+(\w+)\s+([^- ]*)-([^- ]*)-([^- ]*)/i; $distrib->{cfg}->newval('media_info', 'version', $version); $distrib->{cfg}->newval('media_info', 'branch', $branch); @@ -406,4 +391,20 @@ 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. +(c) 2005 Olivier Thauvin + +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 |