Trying to fix unititalized split problem.
authorJeremiah Foster <jeremiah@test.maemo.org>
Thu, 30 Jul 2009 01:04:31 +0000 (04:04 +0300)
committerJeremiah Foster <jeremiah@test.maemo.org>
Thu, 30 Jul 2009 01:04:31 +0000 (04:04 +0300)
minimae

diff --git a/minimae b/minimae
index 19dc060..b0e3b3a 100755 (executable)
--- a/minimae
+++ b/minimae
@@ -26,8 +26,8 @@ ascertain who uploaded it, and if they used the correct email address.
     # Check a debian description file
     minimae -i file.dsc
 
-    # Check a binary .deb
-    minimae -b package_name.deb
+    # Check a deb
+    minimae -i file.deb
 
 =cut
 
@@ -53,19 +53,8 @@ GetOptions
    'help' => \$help,
    'verbose' => \$verbose,
    'inputfile|i=s' => \$inputfile,
-   'binary|b' => \&record_pkgmode,
   );
 
-# Record what type of data is specified
-# Options: -b|--binary, -s|--source, --udeb
-sub record_pkgmode {
-  print "in record_pkgmode\n";
-  $pkg_mode = 'b' if $_[0] eq 'binary';
-  $pkg_mode = 's' if $_[0] eq 'source';
-  $pkg_mode = 'u' if $_[0] eq 'udeb';
-}
-
-
 # --- Process Command line options
 pod2usage(1) if $help;
 
@@ -101,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;
 }