Author: stef-guest Date: 2006-12-28 00:25:37 +0100 (Thu, 28 Dec 2006) New Revision: 5190 Modified: bin/check-new-issues Log: - 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 Modified: bin/check-new-issues ==================================================================--- bin/check-new-issues 2006-12-27 23:10:03 UTC (rev 5189) +++ bin/check-new-issues 2006-12-27 23:25:37 UTC (rev 5190) @@ -6,7 +6,7 @@ #use Smart::Comments; my %opts; -getopts(''ln:fh'', \%opts); +getopts(''ln:fhi:t:T'', \%opts); if ($opts{h}) { print <<"EOF"; @@ -27,9 +27,12 @@ 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 @@ # 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 $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 @@ 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; } }