diff options
author | Raphael Geissert <geissert@debian.org> | 2017-10-11 10:59:16 +0000 |
---|---|---|
committer | Raphael Geissert <geissert@debian.org> | 2017-10-11 10:59:16 +0000 |
commit | 409c284a11d8f19634b987caf3fc62915aeea2f1 (patch) | |
tree | c6675a835453e1d9ba13b106773d3ca6e69347ac /bin/check-new-issues | |
parent | 4447b1af1048fefe6c8cc0e1c066d726e32f1c54 (diff) |
add auto wnpp results as readline history entries
git-svn-id: svn+ssh://svn.debian.org/svn/secure-testing@56605 e39458fd-73e7-0310-bf30-c45bca0a0e42
Diffstat (limited to 'bin/check-new-issues')
-rwxr-xr-x | bin/check-new-issues | 34 |
1 files changed, 27 insertions, 7 deletions
diff --git a/bin/check-new-issues b/bin/check-new-issues index 314824cfeb..b9690a641a 100755 --- a/bin/check-new-issues +++ b/bin/check-new-issues @@ -396,6 +396,18 @@ sub edit_entry { } +sub wnpp_to_history { + my $pkg = shift; + + # there might be more than one bug, so only take the first + my ($bugline) = (split /[|]/, $wnpp{$pkg}, 2); + + my ($type, $bug) = split /\s+/, $bugline; + return unless ($type =~ /^(?:RFP|ITP)$/); + + $term->addhistory("- $pkg <itp> (bug #$bug)"); +} + sub auto_nfu { my $name=shift; @@ -445,7 +457,10 @@ sub auto_search { foreach my $p (split /\s+/, $prog) { search_embed($p); - search_wnpp(qr<^\Q$p\E$>); + for my $we (search_wnpp($p)) { + print "$we: $wnpp{$we}\n"; + wnpp_to_history($we); + } } } if ( $file =~ /^(?:index|default|login|search|admin)\.(?:php3?|asp|cgi|pl)$/i ) { @@ -568,13 +583,18 @@ sub search_embed { sub search_wnpp { my $s = shift; $s = lc $s; - my $found = 0; - foreach my $e (keys %wnpp) { - next unless ($e =~ m/$s/); - print "$e: $wnpp{$e}\n"; - $found = 1; + + my @matches; + @matches = grep(/$s/, sort keys %wnpp); + + if (wantarray) { + return @matches; + } else { + foreach my $e (@matches) { + print "$e: $wnpp{$e}\n"; + } + return (length(@matches) > 0); } - return $found; } sub read_removed_packages_file { |