summaryrefslogtreecommitdiffstats
path: root/bin/check-new-issues
diff options
context:
space:
mode:
authorRaphael Geissert <geissert@debian.org>2017-10-11 10:59:16 +0000
committerRaphael Geissert <geissert@debian.org>2017-10-11 10:59:16 +0000
commit7f8f5b564f2eb56c9f54c7786d8c49b3d3e98591 (patch)
treecff249ba1863dee959b778f4204b599be0c663d2 /bin/check-new-issues
parentda288db55cc587a0cfb0fba19d1b37e075d0639b (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-xbin/check-new-issues34
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 {

© 2014-2024 Faster IT GmbH | imprint | privacy policy