Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.perl.modules > #233

configuring CPAN to apply patches (such as #29468, IPv6 in Net::HTTP)

From Ivan Shmakov <oneingray@gmail.com>
Newsgroups comp.lang.perl.misc, comp.lang.perl.modules
Subject configuring CPAN to apply patches (such as #29468, IPv6 in Net::HTTP)
Followup-To comp.lang.perl.misc
Date 2013-06-28 19:48 +0000
Organization Aioe.org NNTP Server
Message-ID <87ip0y584y.fsf@violet.siamics.net> (permalink)
References <87ehfjmst4.fsf@violet.siamics.net> <u0m61a-t5i1.ln1@anubis.morrow.me.uk> <87txo9j4d5.fsf@violet.siamics.net> <eclk1a-9d21.ln1@anubis.morrow.me.uk> <87d2uh40by.fsf_-_@violet.siamics.net>

Cross-posted to 2 groups.

Followups directed to: comp.lang.perl.misc

Show all headers | View raw


>>>>> Ivan Shmakov <oneingray@gmail.com> writes:
>>>>> Ben Morrow <ben@morrow.me.uk> writes:

	[The particular example given is relevant to a longstanding bug
	in Net::HTTP, thus cross-posting to news:comp.lang.perl.modules.
	Omitting the latter from Followup-To:, though.]

[...]

 >> <pet peeve> The correct place to file a bug in a Perl module is in
 >> its CPAN bug tracker, or, in this case, in the zbar Sourceforce
 >> tracker.

 > BTW, there's a longstanding bug filed at the CPAN RT [2] (along with
 > a patch.)  However, it appears to be filed against libwww-perl, while
 > it actually belongs to Net-HTTP.

 > The question is: how do I reassign it?

 > [2] https://rt.cpan.org/Public/Bug/Display.html?id=29468

	As there seems to be no progress on this one, I've had to
	finally learn the necessary magic for CPAN to patch that
	(trivial) bug for me on each installation attempt.

	The first part of the incantation is altering $CPAN::Config, to
	which I've added "patches_dir":

--cut: ~/.cpan/CPAN/MyConfig.pm --
my $cpan_home
    = ($ENV{"CPAN"}
       // ($ENV{"HOME"} . "/.cpan"));
...
$CPAN::Config = {
...
    'patches_dir' => $cpan_home . q (/patches),
...
    'prefs_dir' => $cpan_home . q (/prefs),
--cut: ~/.cpan/CPAN/MyConfig.pm --

	The "prefs_dir" value was already there, and it's the directory
	I've added the following YAML data:

### 6yy1cmawx4oqu5kdx7qks77n3n.yml  -*- YAML -*-
## Patch the IPv6 support into Net::HTTP
---
match:
    module: "Net::HTTP"
patches:
  - "cpmz4z7w7toa3mk6bi4rmp66n8.patch"
### 6yy1cmawx4oqu5kdx7qks77n3n.yml ends here

	The patch itself goes to the "patches_dir" as specified above
	(it's the same as the one given at [2], yet with an earlier
	$VERSION within the context section of the diff):

--- lib/Net/HTTP.pm.~1~	2011-11-21 20:23:21.000000000 +0000
+++ lib/Net/HTTP.pm	2012-01-08 18:13:21.000000000 +0000
@@ -5,8 +5,13 @@
 
 $VERSION = "6.02";
 unless ($SOCKET_CLASS) {
-    eval { require IO::Socket::INET } || require IO::Socket;
-    $SOCKET_CLASS = "IO::Socket::INET";
+    if (eval { require IO::Socket::INET6 }) {
+        $SOCKET_CLASS = "IO::Socket::INET6";
+    } else {
+        eval { require IO::Socket::INET }
+            || require IO::Socket;
+        $SOCKET_CLASS = "IO::Socket::INET";
+    }
 }
 require Net::HTTP::Methods;
 require Carp;

	Voil`a!  The $ cpan Net::HTTP command that followed resulted in
	the fixed version of the module being installed.  (Even though
	there was an expected "fuzz" warning from patch(1).)

[...]

-- 
FSF associate member #7257

Back to comp.lang.perl.modules | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Imager::QRCode-ing octet sequences vs. zbarimg(1) Ivan Shmakov <oneingray@gmail.com> - 2013-03-13 11:40 +0000
  Re: Imager::QRCode-ing octet sequences vs. zbarimg(1) Ben Morrow <ben@morrow.me.uk> - 2013-03-13 16:27 +0000
    bytes, English, and prototypes Ivan Shmakov <oneingray@gmail.com> - 2013-03-13 17:28 +0000
    Re: Imager::QRCode-ing octet sequences vs. zbarimg(1) Ivan Shmakov <oneingray@gmail.com> - 2013-03-14 20:25 +0000
    Re: Imager::QRCode-ing octet sequences vs. zbarimg(1) Ivan Shmakov <oneingray@gmail.com> - 2013-03-17 17:57 +0000
      Re: Imager::QRCode-ing octet sequences vs. zbarimg(1) Ben Morrow <ben@morrow.me.uk> - 2013-03-18 23:42 +0000
        [OT] reporting bugs Ivan Shmakov <oneingray@gmail.com> - 2013-03-30 11:02 +0000
          Re: reporting bugs Ben Morrow <ben@morrow.me.uk> - 2013-04-01 22:58 +0100
            Re: reporting bugs Ivan Shmakov <oneingray@gmail.com> - 2013-04-06 13:50 +0000
          configuring CPAN to apply patches (such as #29468, IPv6 in Net::HTTP) Ivan Shmakov <oneingray@gmail.com> - 2013-06-28 19:48 +0000

csiph-web