]> git.donarmstrong.com Git - debbugs.git/commitdiff
allow debinfo to be null separated
authorDon Armstrong <don@donarmstrong.com>
Thu, 11 Aug 2016 18:48:46 +0000 (11:48 -0700)
committerDon Armstrong <don@donarmstrong.com>
Thu, 11 Aug 2016 18:48:46 +0000 (11:48 -0700)
bin/debbugs-loadsql

index b1140794d08177390d60882b2527b2a1ec7a3e8f..7eec783ac10479c7b1e80e1e0149134d24964d49 100755 (executable)
@@ -142,6 +142,7 @@ my %subcommands =
      'versions' => {function => \&add_versions,
                    },
      'debinfo' => {function => \&add_debinfo,
+                   arguments => {'0|null' => 0},
                   },
      'maintainers' => {function => \&add_maintainers,
                       },
@@ -302,6 +303,16 @@ sub add_debinfo {
     my ($options,$opts,$p,$config,$argv) = @_;
 
     my @files = @{$argv};
+    if (not @files) {
+       {
+           if ($opts->{0}) {
+               local $/ = "\0";
+           }
+           while (<STDIN>) {
+               push @files, $_;
+           }
+       }
+    }
     return unless @files;
     my $s = db_connect($options);
     my %arch;