From d8c980060cda8346ef6d7a86e63fecc749f91537 Mon Sep 17 00:00:00 2001 From: Don Armstrong Date: Tue, 27 Feb 2018 14:50:41 -0800 Subject: [PATCH] allow providing a directory of debinfo files to loadsql --- bin/debbugs-loadsql | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/bin/debbugs-loadsql b/bin/debbugs-loadsql index 17edf44..b718a05 100755 --- a/bin/debbugs-loadsql +++ b/bin/debbugs-loadsql @@ -142,6 +142,7 @@ use DateTime; use File::stat; use File::Basename; use File::Spec; +use File::Find; use IO::Dir; use IO::File; use IO::Uncompress::AnyUncompress; @@ -184,7 +185,9 @@ my %subcommands = 'versions' => {function => \&add_versions, }, 'debinfo' => {function => \&add_debinfo, - arguments => {'0|null' => 0}, + arguments => {'0|null' => 0, + 'debinfo_dir|debinfo-dir=s' => 0, + }, }, 'maintainers' => {function => \&add_maintainers, }, @@ -369,6 +372,15 @@ sub add_debinfo { my ($options,$opts,$p,$config,$argv) = @_; my @files = @{$argv}; + if (exists $opts->{debinfo_dir} and not @files) { + find(sub { + if (-f $_ and /\.debinfo$/) { + push @files, $File::Find::name; + } + }, + $opts->{debinfo_dir} + ); + } if (not @files) { { local $/ = "\n"; -- 2.39.2