Added lots more modules from lintian. Maemian appears to work.
[maemian] / lib / Maemian / Data.pm
index e529069..a61548a 100644 (file)
@@ -1,5 +1,5 @@
 # -*- perl -*-
 # -*- perl -*-
-# Lintian::Data -- interface to query lists of keywords
+# Maemian::Data -- interface to query lists of keywords
 
 # Copyright (C) 2008 Russ Allbery
 #
 
 # Copyright (C) 2008 Russ Allbery
 #
@@ -16,7 +16,7 @@
 # You should have received a copy of the GNU General Public License along with
 # this program.  If not, see <http://www.gnu.org/licenses/>.
 
 # You should have received a copy of the GNU General Public License along with
 # this program.  If not, see <http://www.gnu.org/licenses/>.
 
-package Lintian::Data;
+package Maemian::Data;
 use strict;
 
 use Carp qw(croak);
 use strict;
 
 use Carp qw(croak);
@@ -32,7 +32,7 @@ use Carp qw(croak);
         my ($class, $type, $separator) = @_;
         croak('no data type specified') unless $type;
         unless (exists $data{$type}) {
         my ($class, $type, $separator) = @_;
         croak('no data type specified') unless $type;
         unless (exists $data{$type}) {
-            my $dir = $ENV{LINTIAN_ROOT} . '/data';
+            my $dir = $ENV{MAEMIAN_ROOT} . '/data';
             open(LIST, '<', "$dir/$type")
                 or croak("unknown data type $type");
             local ($_, $.);
             open(LIST, '<', "$dir/$type")
                 or croak("unknown data type $type");
             local ($_, $.);
@@ -78,15 +78,15 @@ sub value {
 
 =head1 NAME
 
 
 =head1 NAME
 
-Lintian::Data - Lintian interface to query lists of keywords
+Maemian::Data - Maemian interface to query lists of keywords
 
 =head1 SYNOPSIS
 
 
 =head1 SYNOPSIS
 
-    my $list = Lintian::Data->new('type');
+    my $list = Maemian::Data->new('type');
     if ($list->known($keyword)) {
         # do something ...
     }
     if ($list->known($keyword)) {
         # do something ...
     }
-    my $hash = Lintian::Data->new('another-type', '\s+');
+    my $hash = Maemian::Data->new('another-type', '\s+');
     if ($list->value($keyword) > 1) {
         # do something ...
     }
     if ($list->value($keyword) > 1) {
         # do something ...
     }
@@ -94,9 +94,9 @@ Lintian::Data - Lintian interface to query lists of keywords
 
 =head1 DESCRIPTION
 
 
 =head1 DESCRIPTION
 
-Lintian::Data provides a way of loading a list of keywords or key/value
-pairs from a file in the Lintian root and then querying that list.
-The lists are stored in the F<data> directory of the Lintian root and
+Maemian::Data provides a way of loading a list of keywords or key/value
+pairs from a file in the Maemian root and then querying that list.
+The lists are stored in the F<data> directory of the Maemian root and
 consist of one keyword or key/value pair per line.  Blank lines and
 lines beginning with C<#> are ignored.  Leading and trailing whitespace
 is stripped.
 consist of one keyword or key/value pair per line.  Blank lines and
 lines beginning with C<#> are ignored.  Leading and trailing whitespace
 is stripped.
@@ -115,7 +115,7 @@ easily editable files.
 
 =item new(TYPE [,SEPARATOR])
 
 
 =item new(TYPE [,SEPARATOR])
 
-Creates a new Lintian::Data object for the given TYPE.  TYPE is a partial
+Creates a new Maemian::Data object for the given TYPE.  TYPE is a partial
 path relative to the F<data> directory and should correspond to a file in
 that directory.  The contents of that file will be loaded into memory and
 returned as part of the newly created object.  On error, new() throws an
 path relative to the F<data> directory and should correspond to a file in
 that directory.  The contents of that file will be loaded into memory and
 returned as part of the newly created object.  On error, new() throws an
@@ -143,12 +143,12 @@ the number of keywords.
 =item known(KEYWORD)
 
 Returns true if KEYWORD was listed in the data file represented by this
 =item known(KEYWORD)
 
 Returns true if KEYWORD was listed in the data file represented by this
-Lintian::Data instance and false otherwise.
+Maemian::Data instance and false otherwise.
 
 =item value(KEYWORD)
 
 Returns the value attached to KEYWORD if it was listed in the data
 
 =item value(KEYWORD)
 
 Returns the value attached to KEYWORD if it was listed in the data
-file represented by this Lintian::Data instance and the undefined value
+file represented by this Maemian::Data instance and the undefined value
 otherwise. If SEPARATOR was not given, the value will '1'.
 
 =back
 otherwise. If SEPARATOR was not given, the value will '1'.
 
 =back
@@ -164,7 +164,7 @@ new() was called without a TYPE argument.
 =item unknown data type %s
 
 The TYPE argument to new() did not correspond to a file in the F<data>
 =item unknown data type %s
 
 The TYPE argument to new() did not correspond to a file in the F<data>
-directory of the Lintian root.
+directory of the Maemian root.
 
 =back
 
 
 =back
 
@@ -172,7 +172,7 @@ directory of the Lintian root.
 
 =over 4
 
 
 =over 4
 
-=item LINTIAN_ROOT/data
+=item MAEMIAN_ROOT/data
 
 The files loaded by this module must be located in this directory.
 Relative paths containing a C</> are permitted, so files may be organized
 
 The files loaded by this module must be located in this directory.
 Relative paths containing a C</> are permitted, so files may be organized
@@ -184,10 +184,10 @@ in subdirectories in this directory.
 
 =over 4
 
 
 =over 4
 
-=item LINTIAN_ROOT
+=item MAEMIAN_ROOT
 
 
-This variable must be set to Lintian's root directory (normally
-F</usr/share/lintian> when Lintian is installed as a Debian package).  The
+This variable must be set to Maemian's root directory (normally
+F</usr/share/lintian> when Maemian is installed as a Debian package).  The
 B<lintian> program normally takes care of doing this.  This module doesn't
 care about the contents of this directory other than expecting the F<data>
 subdirectory of this directory to contain its files.
 B<lintian> program normally takes care of doing this.  This module doesn't
 care about the contents of this directory other than expecting the F<data>
 subdirectory of this directory to contain its files.
@@ -196,7 +196,7 @@ subdirectory of this directory to contain its files.
 
 =head1 AUTHOR
 
 
 =head1 AUTHOR
 
-Originally written by Russ Allbery <rra@debian.org> for Lintian.
+Originally written by Russ Allbery <rra@debian.org> for Maemian.
 
 =head1 SEE ALSO
 
 
 =head1 SEE ALSO