summaryrefslogtreecommitdiffstats
path: root/bin/check-new-issues
diff options
context:
space:
mode:
authorStefan Fritsch <sf@sfritsch.de>2006-12-27 23:25:37 +0000
committerStefan Fritsch <sf@sfritsch.de>2006-12-27 23:25:37 +0000
commitf097989de6ebb4e5f17e162408c7a8ef211bc235 (patch)
treed8c903291d588e9f8baa96e234c3d73a81a3bdf0 /bin/check-new-issues
parent821a124ef5e558c28f311c3a7e8dcf20873c5650 (diff)
- change regexp to select TODOs from "TODO: check" to "TODO: check$";
old behaviour available with -T any regexp can be specified with -t - regexp for selection of issues based on name can be changed with -i git-svn-id: svn+ssh://svn.debian.org/svn/secure-testing@5190 e39458fd-73e7-0310-bf30-c45bca0a0e42
Diffstat (limited to 'bin/check-new-issues')
-rwxr-xr-xbin/check-new-issues20
1 files changed, 12 insertions, 8 deletions
diff --git a/bin/check-new-issues b/bin/check-new-issues
index d6116b5d6a..0958fce00c 100755
--- a/bin/check-new-issues
+++ b/bin/check-new-issues
@@ -6,7 +6,7 @@ use Getopt::Std;
#use Smart::Comments;
my %opts;
-getopts('ln:fh', \%opts);
+getopts('ln:fhi:t:T', \%opts);
if ($opts{h}) {
print <<"EOF";
@@ -27,9 +27,12 @@ downloads allitems.txt from cve.mitre.org and shows full decription for each
Use "svn diff" and "svn revert" as needed ;-)
OPTIONS: [ -l [-n <n>] [-f] ]
--l : just list issues
--n <n>: show max n lines of each description (default 2)
--f : show full CVE/list entry as well
+-l : just list issues
+-n <n> : show max n lines of each description (default 2)
+-f : show full CVE/list entry as well
+-i regexp : use regexp to select issues (default: 'CVE-200[3-9]' )
+-t regexp : use regexp to select todos (default: '^\s+TODO: check$' )
+-T : same as -t '^\s+TODO: check' (note the missing $)
EOF
@@ -39,8 +42,6 @@ EOF
# TODO/BUGS:
# - go back to previous issue / undo
# - handle entries with several TODO lines
-# - handle other TODOs than "check"
-# - allow setting the regexp to search for
# - handle claimed-by
# - look for ITPs?
@@ -48,6 +49,9 @@ my $datafile="./secure-testing/data/CVE/list";
my $allitemsfile="gunzip -c allitems.txt.gz|";
my $allitemsurl="http://cve.mitre.org/cve/downloads/allitems.txt.gz";
+my $issue_regexp= $opts{i} || 'CVE-200[3-9]';
+my $todo_regexp= $opts{t} || ( $opts{T} ? '^\s+TODO: check' : '^\s+TODO: check$' );
+
my $editor=$ENV{EDITOR} || $ENV{VISUAL} || "vi";
system "wget -N $allitemsurl";
@@ -79,8 +83,8 @@ foreach my $entry (@{$entries}) {
die "invlid entry:\n$entry";
}
$data->{$name}->{entry}=\$entry;
- if ( $entry =~ /^\s+TODO: check/m
- and $name =~ /CVE-200[3-9]/ ) {
+ if ( $entry =~ /$todo_regexp/m
+ and $name =~ /$issue_regexp/ ) {
push @todos, $name;
}
}

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