summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2011-04-08 19:05:20 (GMT)
committerH. Peter Anvin <hpa@zytor.com>2011-04-08 19:05:20 (GMT)
commitd8c325290903db706d3b9053e938ddda397202cb (patch)
tree34aeef4e10305e822bd55f0531721bbc0ae57c4d
parenta6487187b292c6d1a3886f2a8b99e8e3c51db78b (diff)
downloadtip-bot-d8c325290903db706d3b9053e938ddda397202cb.zip
tip-bot-d8c325290903db706d3b9053e938ddda397202cb.tar.gz
tip-bot-d8c325290903db706d3b9053e938ddda397202cb.tar.bz2
tip-bot-d8c325290903db706d3b9053e938ddda397202cb.tar.xz
robotfmt: distingush /r/ and /n/ links
-rwxr-xr-xrobotfmt.pl9
1 files changed, 5 insertions, 4 deletions
diff --git a/robotfmt.pl b/robotfmt.pl
index 90d6d56..c7a0bd1 100755
--- a/robotfmt.pl
+++ b/robotfmt.pl
@@ -116,15 +116,16 @@ while (defined($l = <LOG>)) {
if (Email::Valid->address($e)) {
$cclist{$e}++;
}
- } elsif ($l =~ /^Link:\s*http:\/\/lkml.kernel.org\/r\/\<?([^\;\?\<\>\#]+)\>?$/i) {
- my $ref = uri_unescape($1);
+ } elsif ($l =~ /^Link:\s*http:\/\/lkml.kernel.org\/([rn])\/\<?([^\;\?\<\>\#]+)\>?$/i) {
+ my $type = $1;
+ my $ref = uri_unescape($2);
if ($ref ne '' && $ref !~ /[^!#\$\%&'()*+,-.\/0-9:;=?\@A-Z\[\]_`a-z{|}~]/) {
$ref = '<'.$ref.'>';
$cclist{$lkml}++;
- if ($ref =~ /^\<tip-[0-9a-z]{24}\@git\.kernel\.org\>$/) {
+ if ($type eq 'n' && $ref =~ /^\<tip-[0-9a-z]{24}\@git\.kernel\.org\>$/) {
# New submission magic
$message_id = $ref;
- } elsif ($ref ne $nullref) {
+ } elsif ($type eq 'r' && $ref ne $nullref) {
push(@references, $ref);
}
}