Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the SVN-Notify CPAN distribution.

Report information
The Basics
Id: 43823
Status: resolved
Priority: 0/
Queue: SVN-Notify

People
Owner: Nobody in particular
Requestors: dirk [...] xanthippe.ping.de
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 2.73
Fixed in: 2.79



Subject: ticket_map broken since 2.73
I have moved my svn repo to another server and during that move I have upgraded SVN:Notify from 2.66 to 2.78. Ticket links specified by the ticket_map stopped working with the new install that did work properly before. Downgrading to 2.67 (earliest available in CPAN) made the ticket_map work again. I use the following map: --ticket-map '\b[Mm]antis-(\d+)\b=http://server/mantisbt/view.php?id=%s' and the input Mantis-161: foo bar baz fails to generate a valid ticket. I played around with the regex quite a bit but couldn't make it work with 2.78 regardless of the regex I specified.
Subject: Re: [rt.cpan.org #43823] ticket_map broken since 2.73
Date: Tue, 3 Mar 2009 17:27:55 -0800
To: bug-SVN-Notify [...] rt.cpan.org
From: "David E. Wheeler" <david [...] kineticode.com>
A lot has changed since 2.67. What's the latest version that still works for you? Thanks, David
Subject: Re: [rt.cpan.org #43823] ticket_map broken since 2.73
Date: Wed, 04 Mar 2009 02:50:54 +0100
To: bug-SVN-Notify [...] rt.cpan.org
From: Dirk Olmes <dirk [...] xanthippe.ping.de>
David Wheeler via RT wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=43823 > > > A lot has changed since 2.67. What's the latest version that still > works for you?
Ah, sorry I forgot to mention that: 2.67 is the latest version that works for me. I updated to 2.73 and that breaks the ticket_map so I'm back to 2.67 for the moment. -dirk
Subject: Re: [rt.cpan.org #43823] ticket_map broken since 2.73
Date: Tue, 3 Mar 2009 18:40:35 -0800
To: bug-SVN-Notify [...] rt.cpan.org
From: "David E. Wheeler" <david [...] kineticode.com>
On Mar 3, 2009, at 5:56 PM, Dirk Olmes via RT wrote: Show quoted text
> Ah, sorry I forgot to mention that: 2.67 is the latest version that > works for me. I updated to 2.73 and that breaks the ticket_map so I'm > back to 2.67 for the moment.
I just checked in a test for this and is passes. Can you check it out from SVN and make sure all the tests pass for you? svn co https://svn.kineticode.com/SVN-Notify/trunk SVN-Notify cd SVN-Notify perl Build.PL ./Build test Thanks, David
Subject: Re: [rt.cpan.org #43823] ticket_map broken since 2.73
Date: Thu, 05 Mar 2009 03:52:28 +0100
To: bug-SVN-Notify [...] rt.cpan.org
From: Dirk Olmes <dirk [...] xanthippe.ping.de>
David Wheeler via RT wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=43823 > > > On Mar 3, 2009, at 5:56 PM, Dirk Olmes via RT wrote: >
>> Ah, sorry I forgot to mention that: 2.67 is the latest version that >> works for me. I updated to 2.73 and that breaks the ticket_map so I'm >> back to 2.67 for the moment.
> > I just checked in a test for this and is passes. Can you check it out > from SVN and make sure all the tests pass for you? > > svn co https://svn.kineticode.com/SVN-Notify/trunk SVN-Notify > cd SVN-Notify > perl Build.PL > ./Build test
Strange, that works for me. So where's the difference between my usage and the test? I tried to have a look at t/base.t but have to admit that I don't know enough about Perl's tests to make sense of it :-( Here's the complete commandline I use in my svn hook, maybe that helps to isolate the bug: /usr/bin/svnnotify --repos-path $REPOS --revision $REV \ --to $SVNMAIL_RECIPIENTS --from $SVNMAIL_SENDER \ --smtp $MAILHOST --no-first-line --subject-cx \ --subject-prefix "[SVN] " \ --add-header X-SVN-Repository=$REPOS \ --ticket-map '\b[Mm]antis-(\d+)\b=http://server/mantisbt/view.php?id=%s' \ --revision-url 'http://server/sventon/revinfo.svn?name=RPI&revision=%s' -dirk
Subject: Re: [rt.cpan.org #43823] ticket_map broken since 2.73
Date: Wed, 4 Mar 2009 19:09:46 -0800
To: bug-SVN-Notify [...] rt.cpan.org
From: "David E. Wheeler" <david [...] kineticode.com>
On Mar 4, 2009, at 6:55 PM, Dirk Olmes via RT wrote: Show quoted text
> Here's the complete commandline I use in my svn hook, maybe that helps > to isolate the bug: > > /usr/bin/svnnotify --repos-path $REPOS --revision $REV \ > --to $SVNMAIL_RECIPIENTS --from $SVNMAIL_SENDER \ > --smtp $MAILHOST --no-first-line --subject-cx \ > --subject-prefix "[SVN] " \ > --add-header X-SVN-Repository=$REPOS \ > --ticket-map > '\b[Mm]antis-(\d+)\b=http://server/mantisbt/view.php?id=%s' \ > --revision-url 'http://server/sventon/revinfo.svn?name=RPI&revision= > %s' > > -dirk
I wrote a simple shell script: #!/bin/sh echo $@; Then I ran it like this: % try.sh '\b[Mm]antis-(\d+)\b=http://server/mantisbt/view.php?id= %s' It's output: [Mm]antis-(\d+=http://server/mantisbt/view.php?id=%s So I think you need to escape some stuff. Try this: % try.sh '\\b[Mm]antis-(\d+))\b=http://server/mantisbt/view.php?id=%s' \b[Mm]antis-(\d+)=http://server/mantisbt/view.php?id=%s I have no idea why some backslashed need escaping and some not, or why one ) disappears, but there you go. I suggest that you do some experimentation with the argument until it comes out right. That's the only thing I can think of. :-( Best, David
Subject: Re: [rt.cpan.org #43823] ticket_map broken since 2.73
Date: Thu, 05 Mar 2009 04:34:58 +0100
To: bug-SVN-Notify [...] rt.cpan.org
From: Dirk Olmes <dirk [...] xanthippe.ping.de>
David Wheeler via RT wrote: Show quoted text
> <URL: http://rt.cpan.org/Ticket/Display.html?id=43823 > > > On Mar 4, 2009, at 6:55 PM, Dirk Olmes via RT wrote: >
>> Here's the complete commandline I use in my svn hook, maybe that helps >> to isolate the bug: >> >> /usr/bin/svnnotify --repos-path $REPOS --revision $REV \ >> --to $SVNMAIL_RECIPIENTS --from $SVNMAIL_SENDER \ >> --smtp $MAILHOST --no-first-line --subject-cx \ >> --subject-prefix "[SVN] " \ >> --add-header X-SVN-Repository=$REPOS \ >> --ticket-map >> '\b[Mm]antis-(\d+)\b=http://server/mantisbt/view.php?id=%s' \ >> --revision-url 'http://server/sventon/revinfo.svn?name=RPI&revision= >> %s' >> >> -dirk
> > I wrote a simple shell script: > > #!/bin/sh > echo $@; > > Then I ran it like this: > > % try.sh '\b[Mm]antis-(\d+)\b=http://server/mantisbt/view.php?id= > %s' > > It's output: > > [Mm]antis-(\d+=http://server/mantisbt/view.php?id=%s > > So I think you need to escape some stuff. Try this: > > % try.sh '\\b[Mm]antis-(\d+))\b=http://server/mantisbt/view.php?id=%s' > \b[Mm]antis-(\d+)=http://server/mantisbt/view.php?id=%s > > I have no idea why some backslashed need escaping and some not, or why > one ) disappears, but there you go. I suggest that you do some > experimentation with the argument until it comes out right.
I played around with shell escaping a bit, too now but that doesn't seem to be the culprit: I copied the post-commit shell script to a different location and tried both single quotes (') or double quotes (") but either the ticket map is passed into svnnotify in a wrong format, then I don't get any TicketLink output in my notify mail or, if the format is passed correctly into svnnotify, then I get the following: [...] Log Message: ----------- mantis-176: Neuer Lizenztyp: Gastlizenz Ticket Links: :----------- 2 Modified Paths: -------------- [...] I'm convinced that the shell escaping is not causing this bug as everything works OK with the older version ... -dirk
Subject: Re: [rt.cpan.org #43823] ticket_map broken since 2.73
Date: Wed, 4 Mar 2009 19:37:53 -0800
To: bug-SVN-Notify [...] rt.cpan.org
From: "David E. Wheeler" <david [...] kineticode.com>
On Mar 4, 2009, at 7:35 PM, Dirk Olmes via RT wrote: Show quoted text
> I'm convinced that the shell escaping is not causing this bug as > everything works OK with the older version ...
Okay, thanks for being persistent. Try applying this patch and see what SVN::Notify thinks the regex is: Index: Notify.pm =================================================================== --- Notify.pm (revision 4332) +++ Notify.pm (working copy) @@ -1593,6 +1593,7 @@ my $has_header = 0; $self->run_ticket_map( sub { my ($regex, $url) = @_; + print STDERR "Regex: '$regex'\n"; while ($msg =~ /$regex/ig) { unless ($has_header) { print $out "\nTicket Links:\n:-----------\n"; Best, David
Subject: Re: [rt.cpan.org #43823] ticket_map broken since 2.73
Date: Thu, 05 Mar 2009 08:55:55 +0100
To: bug-SVN-Notify [...] rt.cpan.org
From: Dirk Olmes <dirk [...] xanthippe.ping.de>
David Wheeler via RT wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=43823 > > > On Mar 4, 2009, at 7:35 PM, Dirk Olmes via RT wrote: >
>> I'm convinced that the shell escaping is not causing this bug as >> everything works OK with the older version ...
> > Okay, thanks for being persistent.
Thanks for being patient with me :-) Show quoted text
> Try applying this patch and see what SVN::Notify thinks the regex is: > > Index: Notify.pm > =================================================================== > --- Notify.pm (revision 4332) > +++ Notify.pm (working copy) > @@ -1593,6 +1593,7 @@ > my $has_header = 0; > $self->run_ticket_map( sub { > my ($regex, $url) = @_; > + print STDERR "Regex: '$regex'\n"; > while ($msg =~ /$regex/ig) { > unless ($has_header) { > print $out "\nTicket Links:\n:-----------\n";
Ok, the regex output is: Regex: '\b[Mm]antis-(\d+)\b' and the resulting mail is: Log Message: ----------- mantis-176: Neuer Lizenztyp: Gastlizenz Ticket Links: :----------- 2 Modified Paths: -------------- -dirk
Subject: Re: [rt.cpan.org #43823] ticket_map broken since 2.73
Date: Thu, 5 Mar 2009 07:47:41 -0800
To: bug-SVN-Notify [...] rt.cpan.org
From: "David E. Wheeler" <david [...] kineticode.com>
On Mar 5, 2009, at 12:13 AM, Dirk Olmes via RT wrote: Show quoted text
> Ok, the regex output is: > > Regex: '\b[Mm]antis-(\d+)\b' > > and the resulting mail is: > > Log Message: > ----------- > mantis-176: Neuer Lizenztyp: Gastlizenz > > Ticket Links: > :----------- > 2 > Modified Paths: > --------------
Is that correct? D
Subject: Re: [rt.cpan.org #43823] ticket_map broken since 2.73
Date: Fri, 06 Mar 2009 01:24:23 +0100
To: bug-SVN-Notify [...] rt.cpan.org
From: Dirk Olmes <dirk [...] xanthippe.ping.de>
David Wheeler via RT wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=43823 > > > On Mar 5, 2009, at 12:13 AM, Dirk Olmes via RT wrote: >
>> Ok, the regex output is: >> >> Regex: '\b[Mm]antis-(\d+)\b' >> >> and the resulting mail is: >> >> Log Message: >> ----------- >> mantis-176: Neuer Lizenztyp: Gastlizenz >> >> Ticket Links: >> :----------- >> 2 >> Modified Paths: >> --------------
> > Is that correct?
Sorry, what do you mean? Is the regex wrong? I just changed it to '.*[Mm]antis-(\d+).*' but that doesn't produce a ticket link either. Using 2.67, I get the following output: Log Message: ----------- mantis-176: Neuer Lizenztyp: Gastlizenz Ticket Links: :----------- http://quad64/mantisbt/view.php?id=176 Modified Paths: -------------- Even then, the leading colon below the "Ticket Links:" caption doesn't look correct to me. -dirk
Subject: Re: [rt.cpan.org #43823] ticket_map broken since 2.73
Date: Mon, 9 Mar 2009 10:19:39 -0700
To: bug-SVN-Notify [...] rt.cpan.org
From: "David E. Wheeler" <david [...] kineticode.com>
On Mar 5, 2009, at 4:25 PM, Dirk Olmes via RT wrote: Show quoted text
> Sorry, what do you mean? Is the regex wrong? I just changed it to > '.*[Mm]antis-(\d+).*' but that doesn't produce a ticket link either. > > Using 2.67, I get the following output: > > Log Message: > ----------- > mantis-176: Neuer Lizenztyp: Gastlizenz > > Ticket Links: > :----------- > http://quad64/mantisbt/view.php?id=176 > > Modified Paths: > -------------- > > Even then, the leading colon below the "Ticket Links:" caption doesn't > look correct to me.
That at least is easy to fix; done in r4596. As for the other, I still can't replicate it. :-( To test it, I created this simple script: #!/usr/local/bin/perl -w use strict; use warnings; use feature ':5.10'; print qq{theory 2004-04-20 01:33:35 -0700 (Tue, 20 Apr 2004) 103 mantis-176: Neuer Lizenztyp: Gastlizenz }; Then I put some debugging in SVN::Notify: Index: Notify.pm =================================================================== --- Notify.pm (revision 4596) +++ Notify.pm (working copy) @@ -1593,11 +1593,13 @@ my $has_header = 0; $self->run_ticket_map( sub { my ($regex, $url) = @_; + print STDERR $regex, $/; while ($msg =~ /$regex/ig) { unless ($has_header) { print $out "\nTicket Links:\n------------\n"; $has_header = 1; } + printf STDERR " $url\n", $2 || $1; printf $out " $url\n", $2 || $1; } } ); Then I ran it like so: % perl -Ilib ./bin/svnnotify -p /usr/local/bricolage -r 2 -l ~/bin/try --ticket-map '\b[Mm]antis-(\d+)\b=http://server/mantisbt/view.php?id= %s' --to david@kineticode.com \b[Mm]antis-(\d+)\b http://server/mantisbt/view.php?id=176 You can see there how it output the link, yes? I got the same result with Perl 5.8.8. The only other thing I can think of is if there is some sort of encoding issue that's causing problems. Is that log message all ASCII characters? Has something perhaps been stripped out in our exchanges? Otherwise, I'm at a loss. :-( Best, David
Subject: Re: [rt.cpan.org #43823] ticket_map broken since 2.73
Date: Tue, 10 Mar 2009 18:54:57 +0100
To: bug-SVN-Notify [...] rt.cpan.org
From: Dirk Olmes <dirk [...] xanthippe.ping.de>
Hi David, Show quoted text
>> >> Even then, the leading colon below the "Ticket Links:" caption doesn't >> look correct to me.
> > That at least is easy to fix; done in r4596.
Thanks :-) Show quoted text
> As for the other, I still can't replicate it. :-( To test it, I > created this simple script: > > #!/usr/local/bin/perl -w > > use strict; > use warnings; > use feature ':5.10'; > > print qq{theory > 2004-04-20 01:33:35 -0700 (Tue, 20 Apr 2004) > 103 > mantis-176: Neuer Lizenztyp: Gastlizenz > }; > > Then I put some debugging in SVN::Notify: > > Index: Notify.pm > =================================================================== > --- Notify.pm (revision 4596) > +++ Notify.pm (working copy) > @@ -1593,11 +1593,13 @@ > my $has_header = 0; > $self->run_ticket_map( sub { > my ($regex, $url) = @_; > + print STDERR $regex, $/; > while ($msg =~ /$regex/ig) { > unless ($has_header) { > print $out "\nTicket Links:\n------------\n"; > $has_header = 1; > } > + printf STDERR " $url\n", $2 || $1; > printf $out " $url\n", $2 || $1; > } > } ); > > > Then I ran it like so: > > % perl -Ilib ./bin/svnnotify -p /usr/local/bricolage -r 2 -l ~/bin/try > --ticket-map '\b[Mm]antis-(\d+)\b=http://server/mantisbt/view.php?id= > %s' --to david@kineticode.com > \b[Mm]antis-(\d+)\b > http://server/mantisbt/view.php?id=176 > > You can see there how it output the link, yes? I got the same result > with Perl 5.8.8.
Hmm, I had no success running the command since i miss ~/bin/try and I don't have /usr/local/bricolage on that machine either. I *can* verify that if I run the patched SVN:Notify I get the same output as you above: \b[Mm]antis-(\d+)\b http://server/mantisbt/view.php?id=176 Still, the email that I receive doesn't contain the link. Oh, and I can verify that I run perl 5.8.8 on that machine, too. It's a 64 bit machine with a 64bit Linux if that matters ... I tried sniffing the traffic to the mailserver and I can confirm that the link is not in the eMail that goes out to the SMTP server. Show quoted text
> The only other thing I can think of is if there is some sort of > encoding issue that's causing problems. Is that log message all ASCII > characters? Has something perhaps been stripped out in our exchanges?
I don't think so .. The commit message is exactly what I have sent to you and it doesn't contain any special characters. Thanks for putting your energy into debugging this one with me :-) -dirk
Subject: Re: [rt.cpan.org #43823] ticket_map broken since 2.73
Date: Tue, 10 Mar 2009 11:11:14 -0700
To: bug-SVN-Notify [...] rt.cpan.org
From: "David E. Wheeler" <dwheeler [...] cpan.org>
On Mar 10, 2009, at 10:56 AM, Dirk Olmes via RT wrote: Show quoted text
> Hmm, I had no success running the command since i miss ~/bin/try and I > don't have /usr/local/bricolage on that machine either.
Sorry, ~/bin/try was the script I pasted in, and /usr/local/bricolage was just a directory I pointed at to keep SVN::Notify from bitching about not having an SVN root. Show quoted text
> I *can* verify that if I run the patched SVN:Notify I get the same > output as you above: > > \b[Mm]antis-(\d+)\b > http://server/mantisbt/view.php?id=176 > > Still, the email that I receive doesn't contain the link.
Interesting. Wait, you get the number 2 instead of a link in the message? I see this in an earlier email from you: Ticket Links: :----------- 2 WTF is that 2 doing there? Something is funky with the printf to $out there. Show quoted text
> Oh, and I can > verify that I run perl 5.8.8 on that machine, too. It's a 64 bit > machine > with a 64bit Linux if that matters ...
Is it a vendor build, or did you compile it yourself? Show quoted text
> I don't think so .. The commit message is exactly what I have sent to > you and it doesn't contain any special characters.
Okay, strike that idea, then. Best, David
Subject: Re: [rt.cpan.org #43823] ticket_map broken since 2.73
Date: Wed, 11 Mar 2009 21:33:21 +0100
To: bug-SVN-Notify [...] rt.cpan.org
From: Dirk Olmes <dirk [...] xanthippe.ping.de>
Show quoted text
>> I *can* verify that if I run the patched SVN:Notify I get the same >> output as you above: >> >> \b[Mm]antis-(\d+)\b >> http://server/mantisbt/view.php?id=176 >> >> Still, the email that I receive doesn't contain the link.
> > Interesting. Wait, you get the number 2 instead of a link in the > message? I see this in an earlier email from you: > > Ticket Links: > :----------- > 2 > > WTF is that 2 doing there? Something is funky with the printf to $out > there.
Must be ... that's in the emails as well. Show quoted text
>> Oh, and I can >> verify that I run perl 5.8.8 on that machine, too. It's a 64 bit >> machine >> with a 64bit Linux if that matters ...
> > Is it a vendor build, or did you compile it yourself?
Both :-) I'm on gentoo linux which is a source-based distro i.e. the packages get compiled on the machine for installation. I'm not in the office right now but I can follow up with config details on the perl installation if you think they provide additional info for debugging. -dirk
Subject: Re: [rt.cpan.org #43823] ticket_map broken since 2.73
Date: Wed, 11 Mar 2009 13:40:33 -0700
To: bug-SVN-Notify [...] rt.cpan.org
From: "David E. Wheeler" <dwheeler [...] cpan.org>
On Mar 11, 2009, at 1:36 PM, Dirk Olmes via RT wrote: Show quoted text
>> WTF is that 2 doing there? Something is funky with the printf to $out >> there.
> > Must be ... that's in the emails as well. >
>>> Oh, and I can >>> verify that I run perl 5.8.8 on that machine, too. It's a 64 bit >>> machine >>> with a 64bit Linux if that matters ...
>> >> Is it a vendor build, or did you compile it yourself?
> > Both :-) I'm on gentoo linux which is a source-based distro i.e. the > packages get compiled on the machine for installation. I'm not in the > office right now but I can follow up with config details on the perl > installation if you think they provide additional info for debugging.
You're going to have to do some debugging by putting `print STDERR` statements here and there to see if you can figure out WTF is going on. I'm out of ideas, I'm afraid, though I *would* suggest trying to compile your own Perl rather than rely on Gentoo's compile, which likely applies patches that break Perl. Best, David
Subject: Re: [rt.cpan.org #43823] ticket_map broken since 2.73
Date: Wed, 18 Mar 2009 04:36:14 +0100
To: bug-SVN-Notify [...] rt.cpan.org
From: Dirk Olmes <dirk [...] xanthippe.ping.de>
David Wheeler via RT wrote: Show quoted text
> <URL: http://rt.cpan.org/Ticket/Display.html?id=43823 > > > On Mar 11, 2009, at 1:36 PM, Dirk Olmes via RT wrote: >
>>> WTF is that 2 doing there? Something is funky with the printf to $out >>> there.
>> Must be ... that's in the emails as well. >>
>>>> Oh, and I can >>>> verify that I run perl 5.8.8 on that machine, too. It's a 64 bit >>>> machine >>>> with a 64bit Linux if that matters ...
>>> Is it a vendor build, or did you compile it yourself?
>> Both :-) I'm on gentoo linux which is a source-based distro i.e. the >> packages get compiled on the machine for installation. I'm not in the >> office right now but I can follow up with config details on the perl >> installation if you think they provide additional info for debugging.
> > You're going to have to do some debugging by putting `print STDERR` > statements here and there to see if you can figure out WTF is going > on.
I finally found some time to do some printf debugging. Warning in advance: I seriously used perl about 10 years ago so I might be doing dumb things here ... I started to search around line 1593 in Notify.pm which was the place where we put the print STDERR to see if we get the correct url output. Since we see the correct ouptut on STDERR but not on the mail I dug down into SVN::Notify::SMTP to see what arrives in the PRINTF function there (that's in line 2417ff). If I understand the construct shift->PRINT( sprintf @_ ) correctly, that's supposed to run sprintf on the incoming array which should contain two args, namely the url and the parsed bug number. Inspecting @_ I found that it actually contains three elements: element: SVN::Notify::SMTP=HASH(0xb87110) element: http://quad64/mantisbt/view.php?id=%s element: 176 (note the element: prefix is debugging output from me). Could this be the culprit? If I do something like my $result = sprintf $_[1], $_[2]; and send that down the stream, the URL arrives in the mail correctly. -dirk
Subject: Re: [rt.cpan.org #43823] ticket_map broken since 2.73
Date: Tue, 17 Mar 2009 21:16:18 -0700
To: bug-SVN-Notify [...] rt.cpan.org
From: "David E. Wheeler" <david [...] kineticode.com>
On Mar 17, 2009, at 8:35 PM, Dirk Olmes via RT wrote: Show quoted text
> If I understand the construct > > shift->PRINT( sprintf @_ ) > > correctly, that's supposed to run sprintf on the incoming array which > should contain two args, namely the url and the parsed bug number. > Inspecting @_ I found that it actually contains three elements: > > element: SVN::Notify::SMTP=HASH(0xb87110) > element: http://quad64/mantisbt/view.php?id=%s > > element: 176 > > (note the element: prefix is debugging output from me). > > Could this be the culprit? If I do something like > > my $result = sprintf $_[1], $_[2]; > > and send that down the stream, the URL arrives in the mail correctly.
Yep, that's the culprit. Bizarre that the object isn't shifted off by the `shift` before sprintf does its thing. I'm going to change it to: sub PRINTF { my $self = shift; $self->PRINT( sprintf(@_) ); } And that should do the trick. Nice debugging; thanks! David
Subject: Re: [rt.cpan.org #43823] ticket_map broken since 2.73
Date: Wed, 18 Mar 2009 08:27:55 +0100
To: bug-SVN-Notify [...] rt.cpan.org
From: Dirk Olmes <dirk [...] xanthippe.ping.de>
Show quoted text
>> correctly, that's supposed to run sprintf on the incoming array which >> should contain two args, namely the url and the parsed bug number. >> Inspecting @_ I found that it actually contains three elements: >> >> element: SVN::Notify::SMTP=HASH(0xb87110) >> element: http://quad64/mantisbt/view.php?id=%s >> >> element: 176 >> >> (note the element: prefix is debugging output from me). >> >> Could this be the culprit? If I do something like >> >> my $result = sprintf $_[1], $_[2]; >> >> and send that down the stream, the URL arrives in the mail correctly.
> > Yep, that's the culprit. Bizarre that the object isn't shifted off by > the `shift` before sprintf does its thing. I'm going to change it to: > > sub PRINTF { > my $self = shift; > $self->PRINT( sprintf(@_) ); > } > > And that should do the trick.
Hmm, I tried your fix and it doesn't work :-( I printed $self as well as @_ after the shift and everything looks ok: self: SVN::Notify::SMTP=HASH(0xb867d0) rest: http://quad64/mantisbt/view.php?id=%s 176 But the mail still does not contain a valid link :-( I suspect it's the sprintf here because if I STDERR an sprintf(@_) after the shift I get the same wrong output as in the mail. If I take out the two individual elements ($_[0] and $_[1]) then the sprintf produces the correct link. Strange ... Show quoted text
> Nice debugging; thanks!
Thanks for the heads up :-) -dirk
Subject: Re: [rt.cpan.org #43823] ticket_map broken since 2.73
Date: Thu, 19 Mar 2009 14:51:49 +0100
To: bug-SVN-Notify [...] rt.cpan.org
From: Dirk Olmes <dirk [...] xanthippe.ping.de>
Show quoted text
>> If I understand the construct >> >> shift->PRINT( sprintf @_ ) >> >> correctly, that's supposed to run sprintf on the incoming array which >> should contain two args, namely the url and the parsed bug number. >> Inspecting @_ I found that it actually contains three elements: >> >> element: SVN::Notify::SMTP=HASH(0xb87110) >> element: http://quad64/mantisbt/view.php?id=%s >> >> element: 176 >> >> (note the element: prefix is debugging output from me). >> >> Could this be the culprit? If I do something like >> >> my $result = sprintf $_[1], $_[2]; >> >> and send that down the stream, the URL arrives in the mail correctly.
> > Yep, that's the culprit. Bizarre that the object isn't shifted off by > the `shift` before sprintf does its thing. I'm going to change it to: > > sub PRINTF { > my $self = shift; > $self->PRINT( sprintf(@_) ); > } > > And that should do the trick.
David, what about getting around the whole PRINTF magic and doing print $out " ", sprintf ($url, $2 || $1), "\n"; in Notify.pm around line 1593? This works fine for me. -dirk
Subject: Re: [rt.cpan.org #43823] ticket_map broken since 2.73
Date: Thu, 19 Mar 2009 09:37:22 -0700
To: bug-SVN-Notify [...] rt.cpan.org
From: "David E. Wheeler" <dwheeler [...] cpan.org>
On Mar 19, 2009, at 1:35 AM, Dirk Olmes via RT wrote: Show quoted text
> Hmm, I tried your fix and it doesn't work :-( I printed $self as > well as > @_ after the shift and everything looks ok: > > self: SVN::Notify::SMTP=HASH(0xb867d0) > rest: http://quad64/mantisbt/view.php?id=%s > 176 > > But the mail still does not contain a valid link :-( > > I suspect it's the sprintf here because if I STDERR an sprintf(@_) > after > the shift I get the same wrong output as in the mail. If I take out > the > two individual elements ($_[0] and $_[1]) then the sprintf produces > the > correct link. Strange ...
Yes, it's because of the signature for printf: It wants a scalar followed by a list, not just a list. So this should work: sub PRINTF { my $self = shift; $self->PRINT( sprintf(shift, @_) ); } Best, David
Subject: Re: [rt.cpan.org #43823] ticket_map broken since 2.73
Date: Thu, 19 Mar 2009 09:54:53 -0700
To: bug-SVN-Notify [...] rt.cpan.org
From: "David E. Wheeler" <dwheeler [...] cpan.org>
On Mar 19, 2009, at 6:55 AM, Dirk Olmes via RT wrote: Show quoted text
>> And that should do the trick.
> > David, what about getting around the whole PRINTF magic and doing > > print $out " ", sprintf ($url, $2 || $1), "\n"; > > in Notify.pm around line 1593? This works fine for me.
I've now replicated the issue in a test, and made it pass with what I sent a few minutes ago. So I think we're finally good to go! Thanks, David
Subject: Re: [rt.cpan.org #43823] ticket_map broken since 2.73
Date: Thu, 19 Mar 2009 18:25:18 +0100
To: bug-SVN-Notify [...] rt.cpan.org
From: Dirk Olmes <dirk [...] xanthippe.ping.de>
David Wheeler via RT wrote: Show quoted text
> <URL: http://rt.cpan.org/Ticket/Display.html?id=43823 > > > On Mar 19, 2009, at 6:55 AM, Dirk Olmes via RT wrote: >
>>> And that should do the trick.
>> David, what about getting around the whole PRINTF magic and doing >> >> print $out " ", sprintf ($url, $2 || $1), "\n"; >> >> in Notify.pm around line 1593? This works fine for me.
> > I've now replicated the issue in a test, and made it pass with what I > sent a few minutes ago. So I think we're finally good to go!
Yep, I just manually tested your proposed fix and that works for me, too. Thanks for your help! -dirk
Subject: Re: [rt.cpan.org #43823] ticket_map broken since 2.73
Date: Wed, 01 Apr 2009 04:57:14 +0200
To: bug-SVN-Notify [...] rt.cpan.org
From: Dirk Olmes <dirk [...] xanthippe.ping.de>
David Wheeler via RT wrote: Show quoted text
> <URL: http://rt.cpan.org/Ticket/Display.html?id=43823 > > > On Mar 19, 2009, at 6:55 AM, Dirk Olmes via RT wrote: >
>>> And that should do the trick.
>> David, what about getting around the whole PRINTF magic and doing >> >> print $out " ", sprintf ($url, $2 || $1), "\n"; >> >> in Notify.pm around line 1593? This works fine for me.
> > I've now replicated the issue in a test, and made it pass with what I > sent a few minutes ago. So I think we're finally good to go!
David, does this fix warrant a new release? I'd like to update my production server using this bugfix. -dirk
Subject: Re: [rt.cpan.org #43823] ticket_map broken since 2.73
Date: Thu, 2 Apr 2009 10:31:52 -0700
To: bug-SVN-Notify [...] rt.cpan.org
From: "David E. Wheeler" <david [...] kineticode.com>
On Mar 31, 2009, at 8:05 PM, Dirk Olmes via RT wrote: Show quoted text
>> I've now replicated the issue in a test, and made it pass with what I >> sent a few minutes ago. So I think we're finally good to go!
> > David, does this fix warrant a new release? I'd like to update my > production server using this bugfix.
Yeah, I'll package one up today. Best, David