=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
=cut
-use strict;
+use strict; # Warnings turned on via -w
use lib qw(lib/);
use Getopt::Long;
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;
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;
"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
$$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";
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");
return 1;
}
-# -------------------------------
-
# get package name, version, and file name from the lab
sub get_bin_info_from_lab {
my ($base_dir) = @_;
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.
$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__