summaryrefslogtreecommitdiffstats
path: root/bin/check-new-issues
diff options
context:
space:
mode:
authorRaphael Geissert <geissert@debian.org>2017-12-21 12:01:22 +0000
committerRaphael Geissert <geissert@debian.org>2017-12-21 12:01:22 +0000
commit1ea87e5f6ecf73d305a7d3188eb46f8500a493b1 (patch)
tree90ff264fa678e89581e922e0f3f14b3d195494a6 /bin/check-new-issues
parent5a2df7b4c68e77f15a61265e62fa9ade25a32e41 (diff)
check-new-issues: add -b, to auto process entries
git-svn-id: svn+ssh://svn.debian.org/svn/secure-testing@58778 e39458fd-73e7-0310-bf30-c45bca0a0e42
Diffstat (limited to 'bin/check-new-issues')
-rwxr-xr-xbin/check-new-issues27
1 files changed, 23 insertions, 4 deletions
diff --git a/bin/check-new-issues b/bin/check-new-issues
index e2a5c693ea..4e0d657357 100755
--- a/bin/check-new-issues
+++ b/bin/check-new-issues
@@ -7,7 +7,7 @@ use Getopt::Std;
use Term::ReadLine;
my %opts;
-getopts('ln:fhi:t:Tca:e:uUsD', \%opts);
+getopts('ln:fhi:t:Tca:e:uUsDb', \%opts);
sub print_commands {
print <<'EOF';
@@ -58,6 +58,7 @@ OPTIONS: [ -l [-n <n>] [-f] ]
-s : skip automatic apt-cache/apt-file searches, suggest the
command to run instead
-D : skip the download operations
+-b : auto process entries (e.g. NFUs)
EOF
@@ -221,6 +222,21 @@ if ($opts{l}) {
exit 0;
}
+if ($opts{b}) {
+ # auto process
+ foreach my $todo (sort {$b <=> $a} @todos) {
+ if ($data->{$todo}->{CVE}) {
+ my $nfu_entry = auto_nfu($todo);
+ if ($nfu_entry) {
+ ${$data->{$todo}->{entry}} =~
+ s/^\s*TODO: check/\tNOT-FOR-US: $nfu_entry/m ;
+ next;
+ }
+ }
+ }
+ save_datafile();
+ exit 0;
+}
my $term = new Term::ReadLine 'check-new-issues';
if ($term->ReadLine() eq 'Term::ReadLine::Stub') {
@@ -274,10 +290,13 @@ $attribs->{attempted_completion_function} = \&initial_completion;
foreach my $todo (sort {$b <=> $a} @todos) {
last unless present_issue($todo);
}
+save_datafile();
-open(my $fh, ">", $datafile);
-print $fh @{$entries};
-close($fh);
+sub save_datafile {
+ open(my $fh, ">", $datafile);
+ print $fh @{$entries};
+ close($fh);
+}
sub present_issue {
my $name = shift;

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