retitle 655696 libwww-curl-perl: missing CURLAUTH_* constants tag 655696 patch thanks
On Fri, Jan 13, 2012 at 11:56:43AM +0200, Niko Tyni wrote: > Package: libwww-curl-perl > Version: 4.12-1 > Severity: important > Tags: squeeze > > On Fri, Jan 13, 2012 at 10:05:14AM +0100, David Schneider wrote: > > hey folks > libwww-curl-perl seems to have a bug. it sends basic insted of ntlm > > header despite that i have defined the option CURLAUTH_NTLM > > libwww-curl-perl 4.12-1 > > debian: squeeze > Bareword "CURLAUTH_NTLM" not allowed while "strict subs" in use at t.pl line > 24. > Exporting libcurl constants to the perl side has had bugs in the > past, and http://cpansearch.perl.org/src/SZBALINT/WWW-Curl-4.15/Changes > indicates upstream has fixed this since, > > Indeed, it's working OK for me on Debian sid (4.15-1+b2). > > I don't have the time to dig out a patch, but this does look > like a candidate for a stable update IMO, particularly if it concerns > other curl constants too. Ow, I think I've looked at the curl.h "parsing" in Makefile.PL in the past, but I didn't recall how ad-hoc it is/was. I'm surprised it keeps working at all between libcurl releases. The joy of parsing C #defines and enums in Perl. 4.15 is a lot better in that it doesn't pretend to know all the libcurl constant groups by name; unfortunately the patch looks too intrusive for a stable update. The attached patch just adds the CURLAUTH_* constants. It seems to work for me, but testers / eyeballs would be welcome before considering this to the stable update process. -- Niko Tyni [email protected]
>From c3ee003c2f826a37e538c6faf6a5b4fb7e9c7b1f Mon Sep 17 00:00:00 2001 From: Niko Tyni <[email protected]> Date: Fri, 13 Jan 2012 19:32:31 +0200 Subject: [PATCH] Include CURLAUTH_* constants from libcurl WWW::Curl 4.15 reworked the handling of libcurl constants, but that's too intrusive for a Debian stable update. So include just CURLAUTH_* in the old style. --- Makefile.PL | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/Makefile.PL b/Makefile.PL index d40c7fb..4f140b8 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -109,6 +109,8 @@ if (!defined($curl_h)) { my ($option, $value) = m/^#define CURLOPT_(\w+)\s+CURLOPT_(\w+)/; $constants{CURLOPT_}->{$option} = $value; + } elsif ($_ =~ m/^#define CURLAUTH_(\w+)/) { + $constants{CURLAUTH_}->{$1} = $1; } elsif ($_ =~ m/^\s*(CURLINFO_|CURLSHOPT_|CURL_LOCK_DATA_|CURLE_|CURL_NETRC_)(\w+)/) { $constants{$1}->{$2} = $2; } elsif ($_ =~ m/^\s*CURLPROXY_(\w+)\s*=\s*\d+/) { @@ -188,7 +190,7 @@ HERE if ($line !~ m/^\@CURLOPT_INCLUDE\@/) { print EASY_PM $line; } else { - for my $group (qw/CURLOPT_ CURLINFO_ CURLE_ CURL_NETRC_ CURLPROXY_/) { + for my $group (qw/CURLOPT_ CURLINFO_ CURLE_ CURL_NETRC_ CURLPROXY_ CURLAUTH_/) { for my $option (sort keys %{$constants{$group}}) { next unless $option; print EASY_PM $group.$option."\n"; -- 1.7.8.2

