Added some code to peer into a data structure in Maemian/Schedule.pm. Also added the
[maemian] / maemian
diff --git a/maemian b/maemian
index b3e7ac0..7c00ab2 100755 (executable)
--- a/maemian
+++ b/maemian
@@ -28,7 +28,7 @@ maemian - Maemo package checker
 
 =head1
 
-Maemian is the maemo version of maemian - a policy checker designed to
+Maemian is the maemo version of lintian - a policy checker designed to
 assure the quality of a package uploaded into the maemo.org repositories.
 The goal of maemian is to improve quality by checking that the maemo
 packaging policy is followed. In order to do that it reads files in the
@@ -37,7 +37,7 @@ ascertain who uploaded it, and if they used the correct email address.
 
 =cut
 
-use strict;
+use strict;          # Warnings turned on via -w
 use lib qw(lib/);
 use Getopt::Long;
 
@@ -72,12 +72,11 @@ my $packages_file = 0;              #string for the -p option
 our $OPT_MAEMIAN_LAB = "";     #string for the --lab option
 our $OPT_MAEMIAN_ARCHIVEDIR = "";#string for the --archivedir option
 our $OPT_MAEMIAN_DIST = "";    #string for the --dist option
-our $OPT_MAEMIAN_ARCH = "";    #string for the --arch option
 our $OPT_MAEMIAN_AREA = "";    #string for the --area option
 # These options can also be used via default or environment variables
 our $MAEMIAN_CFG = "";         #config file to use
 our $MAEMIAN_ROOT = "/home/jeremiah/maemian/"; #location of the maemian modules
-our $OPT_MAEMIAN_SECTION = "";  #old name for OPT_MAEMIAN_ARCH
+my $MAEMIAN_ARCH = "any";
 
 my $experimental_output_opts = undef;
 
@@ -110,12 +109,8 @@ our $MAEMIAN_LAB = undef;
 our $MAEMIAN_ARCHIVEDIR = undef;
 our $MAEMIAN_DIST = undef;
 our $MAEMIAN_UNPACK_LEVEL = undef;
-our $MAEMIAN_ARCH = undef;
 our $MAEMIAN_SECTION = undef;
 our $MAEMIAN_AREA = undef;
-# }}}
-
-# {{{ Setup Code
 
 #turn off file buffering
 $| = 1;
@@ -457,7 +452,6 @@ my %opthash = (
               "dist=s" => \$OPT_MAEMIAN_DIST,
               "area=s" => \$OPT_MAEMIAN_AREA,
               "section=s" => \$OPT_MAEMIAN_AREA,
-              "arch=s" => \$OPT_MAEMIAN_ARCH,
               "root=s" => \$MAEMIAN_ROOT,
 
               # ------------------ package selection options
@@ -588,15 +582,6 @@ foreach (VARS) {
     $$var = $$opt_var if $$opt_var;
 }
 
-# MAEMIAN_ARCH must have a value.
-unless (defined $MAEMIAN_ARCH) {
-    if ($MAEMIAN_DIST) {
-       chop($MAEMIAN_ARCH=`dpkg --print-architecture`);
-    } else {
-       $MAEMIAN_ARCH = 'any';
-    }
-}
-
 # MAEMIAN_SECTION is deprecated in favour of MAEMIAN_AREA
 if (defined $MAEMIAN_SECTION) {
     print STDERR "warning: MAEMIAN_SECTION has been deprecated in favour of MAEMIAN_AREA.\n";
@@ -1061,22 +1046,20 @@ if (not $check_everything and not $packages_file and not $schedule->count) {
     v_msg("No packages selected.");
     exit $exit_code;
 }
-# }}}
 
-# {{{ A lone subroutine
-#----------------------------------------------------------------------------
 #  Check to make sure there are packages to check.
 sub set_value {
     my ($f,$target,$field,$source,$required) = @_;
+    use YAML;
+#    print map { Dump($_) } @_;
     if ($required and not $source->{$field}) {
-       fail("description file $f does not define required tag $field");
+      print Dump($f)."\n";
+      fail("description file $f does not define required tag $field");
     }
     $target->{$field} = $source->{$field};
     delete $source->{$field};
 }
-# }}}
 
-# {{{ Load information about collector scripts
 opendir(COLLDIR, "$MAEMIAN_ROOT/collection")
     or fail("cannot read directory $MAEMIAN_ROOT/collection");
 
@@ -1834,8 +1817,6 @@ sub remove_status_file {
     return 1;
 }
 
-# -------------------------------
-
 # get package name, version, and file name from the lab
 sub get_bin_info_from_lab {
     my ($base_dir) = @_;
@@ -1873,26 +1854,21 @@ sub get_src_info_from_lab {
     return ($file, source => $pkg, version => $ver);
 }
 
-# -------------------------------
-
 # read first line of a file
 sub read_file {
-    my $t;
+    my $first_line;
 
     open(T, '<', $_[0]) or return;
-    chop($t = <T>);
+    chop($first_line = <T>);
     close(T) or return;
 
-    return $t;
+    return $first_line;
 }
 
 # sort collection list by `order'
 sub by_collection_order {
     $collection_info{$a}->{'order'} <=> $collection_info{$b}->{'order'};
 }
-# }}}
-
-# {{{ Exit handler.
 
 sub END {
     # Prevent Lab::delete from affecting the exit code.
@@ -1908,10 +1884,6 @@ sub interrupted {
     $SIG{$_[0]} = 'DEFAULT';
     die "N: Interrupted.\n";
 }
-# }}}
 
-# Local Variables:
-# indent-tabs-mode: t
-# cperl-indent-level: 4
-# End:
-# vim: sw=4 ts=8 noet fdm=marker
+1;
+__END__