Commit e9876098 authored by dave%intrec.com's avatar dave%intrec.com

Refix for bug 25693: more accurate regexp to find duplicates when generating…

Refix for bug 25693: more accurate regexp to find duplicates when generating initial duplicates table.
parent 59742102
...@@ -2029,7 +2029,7 @@ if (!($sth->fetchrow_arrayref()->[0])) { ...@@ -2029,7 +2029,7 @@ if (!($sth->fetchrow_arrayref()->[0])) {
print("Populating duplicates table...\n"); print("Populating duplicates table...\n");
$sth = $dbh->prepare("SELECT longdescs.bug_id, thetext FROM longdescs left JOIN bugs using(bug_id) WHERE (thetext " . $sth = $dbh->prepare("SELECT longdescs.bug_id, thetext FROM longdescs left JOIN bugs using(bug_id) WHERE (thetext " .
"regexp 'This bug has been marked as a duplicate of') AND (resolution = 'DUPLICATE') ORDER" . "regexp '[.*.]{3,3} This bug has been marked as a duplicate of [[:digit:]]{1,5} [.*.]{3,3}') AND (resolution = 'DUPLICATE') ORDER" .
" BY longdescs.bug_when"); " BY longdescs.bug_when");
$sth->execute(); $sth->execute();
...@@ -2044,7 +2044,7 @@ if (!($sth->fetchrow_arrayref()->[0])) { ...@@ -2044,7 +2044,7 @@ if (!($sth->fetchrow_arrayref()->[0])) {
foreach $key (keys(%dupes)) foreach $key (keys(%dupes))
{ {
$dupes{$key} =~ s/.*This bug has been marked as a duplicate of (\d{1,5}).*/$1/sm; $dupes{$key} =~ s/.*\*\*\* This bug has been marked as a duplicate of (\d{1,5}) \*\*\*.*?/$1/sm;
$dbh->do("INSERT INTO duplicates VALUES('$dupes{$key}', '$key')"); $dbh->do("INSERT INTO duplicates VALUES('$dupes{$key}', '$key')");
# BugItsADupeOf Dupe # BugItsADupeOf Dupe
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment