X-Git-Url: http://vcs.maemo.org/git/?a=blobdiff_plain;f=minimae;h=b0e3b3a3da646fe3e6f4e91fbf698c28798d8c30;hb=HEAD;hp=30b9261b304d9041b5ac7dc9b5a8d1ca1df08c46;hpb=84b6a5bd29b0b1e960c4b6012eea3dfff93180f2;p=maemian diff --git a/minimae b/minimae index 30b9261..b0e3b3a 100755 --- a/minimae +++ b/minimae @@ -8,6 +8,10 @@ minimae - A small, cuddly version of maemian +=head1 VERSION + +This document describes minimae version 0.1 + =head1 PURPOSE Maemian is the maemo version of lintian - a policy checker designed to @@ -22,6 +26,9 @@ ascertain who uploaded it, and if they used the correct email address. # Check a debian description file minimae -i file.dsc + # Check a deb + minimae -i file.deb + =cut use strict; @@ -31,10 +38,15 @@ use Pod::Usage; use Carp; use lib qw(/home/jeremiah/maemian/lib/); use Maemian::Output; +use Maemian::Schedule; + +my $LINTIAN_LAB = "/home/jeremiah/maemian/lab"; # --- Command line options -my $inputfile; # --- A file passed on the command line -my ($help, $verbose); +my $pkg_mode = 'a'; # auto -- automatically search for + # binary and source pkgs +my $inputfile; # --- A file passed on the command line +my ($help, $verbose, ); GetOptions ( @@ -44,10 +56,9 @@ GetOptions ); # --- Process Command line options -pod2usage() if $help; -pod2usage() if not $inputfile; +pod2usage(1) if $help; -# --- Output settings. +# --- Output settings my $out = new Maemian::Output; if ($verbose) { $out->verbose(1); @@ -79,7 +90,13 @@ sub file_tests { # We push the entire file into an array # If the file is signed, the sig is separated by a blank line my @control = slurp $file, { irs => qr/\n\n/xms }; - my @lines = split /\n/, $control[1]; + my @lines; + if ($#control > 1) { + @lines = split /\n/, $control[1]; + } + else { + @lines = split /\n/, $control[0]; + } print map { $_ } grep /Maintainer/, @lines; } @@ -89,5 +106,17 @@ if ($inputfile) { croak "No input file found: $!\n"; } +my $schedule = new Maemian::Schedule(verbose => $verbose); +# .deb file? +if ($inputfile =~ /\.deb$/) { + $out->v_msg("Lab is $LINTIAN_LAB"); + + # schedule is a hash containing two hashes followed by an array + $schedule->add_deb('b', $inputfile) + or warning("$inputfile is a zero-byte file, skipping"); +} + + + 1;