Skip Menu |

This queue is for tickets about the Net-DNS CPAN distribution.

Report information
The Basics
Id: 60725
Status: resolved
Priority: 0/
Queue: Net-DNS

People
Owner: Nobody in particular
Requestors: rurban [...] x-ray.at
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.66
Fixed in: (no value)



Subject: Enable Cygwin resolver
Attached patch enables the Cygwin resolver. We do not want to depend on Win32::IPHelper and Win32::API on cygwin. Reini - cygwin maintainer for perl
Subject: Net-DNS-0.66-cygwin.patch
Enable Cygwin resolver. Do not depend on Win32::IPHelper and Win32::API on cygwin diff -u Net-DNS-0.66/Makefile.PL.orig --- Net-DNS-0.66/Makefile.PL.orig 2010-08-23 16:24:36.818945600 +0200 +++ Net-DNS-0.66/Makefile.PL 2010-08-24 09:32:39.713174700 +0200 @@ -90,16 +93,15 @@ -if ($^O eq 'MSWin32' || $^O eq 'cygwin') { +if ($^O eq 'MSWin32') { unless( eval {require WIN32::API; } ){ warn <<AMEN; I can not find WIN32::API version 0.55 or higher. - I will add WIN32::API to the list of prerequisites. AMEN -if ( $^O eq "MSWin32" ){ +if ( $^O eq "MSWin32" ){ warn <<AMEN2; Note that, WIN32::API is included in recent versions of ActivePerl (5.10 since build 1003) and recent @@ -108,11 +110,6 @@ tested with other versions. In case of failure please consider upgrading. AMEN2 -}else{ - warn <<AMEN3; -When using cygwin missing dependencies can be installed using CPAN. -AMEN3 - } @@ -158,13 +155,6 @@ } } - - - - - - - if ($use_xs) { # turn the XS bits on. print "Activating XS Magic...\n" if DEBUG; diff -u Net-DNS-0.66/lib/Net/DNS/Resolver.pm.orig --- Net-DNS-0.66/lib/Net/DNS/Resolver.pm.orig 2010-08-23 16:24:37.328996600 +0200 +++ Net-DNS-0.66/lib/Net/DNS/Resolver.pm 2010-08-23 16:52:24.986184800 +0200 @@ -8,18 +8,18 @@ $VERSION = (qw$LastChangedRevision: 830 $)[1]; -BEGIN { +#BEGIN { if ($^O eq 'MSWin32') { require Net::DNS::Resolver::Win32; @ISA = qw(Net::DNS::Resolver::Win32); } elsif ($^O eq 'cygwin') { - require Net::DNS::Resolver::Win32; - @ISA = qw(Net::DNS::Resolver::Win32); - } else { + require Net::DNS::Resolver::Cygwin; + @ISA = qw(Net::DNS::Resolver::Cygwin); + } else { require Net::DNS::Resolver::UNIX; @ISA = qw(Net::DNS::Resolver::UNIX); } -} +#} __PACKAGE__->init(); diff -u Net-DNS-0.66/lib/Net/DNS/Resolver/Cygwin.pm.orig --- Net-DNS-0.66/lib/Net/DNS/Resolver/Cygwin.pm.orig 2009-12-30 11:01:40.000000000 +0100 +++ Net-DNS-0.66/lib/Net/DNS/Resolver/Cygwin.pm 2010-08-25 12:10:17.255289300 +0200 @@ -1,4 +1,4 @@ -package Net::DNS::Resolver::Cygwin; +package Net::DNS::Resolver::Cygwin; # -*- tab-width:4 -*- # # $Id: Cygwin.pm 696 2007-12-28 13:46:20Z olaf $ # @@ -19,7 +19,7 @@ if (open(LM, "<$key")) { $value = <LM>; - $value =~ s/\0+$//; + $value =~ s/\0+$// if $value; close(LM); } @@ -33,7 +33,7 @@ local *LM; my $root = '/proc/registry/HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services/Tcpip/Parameters/'; - + unless (-d $root) { # Doesn't exist, maybe we are on 95/98/Me? $root = '/proc/registry/HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services/VxD/MSTCP/'; @@ -90,12 +90,13 @@ my $ip; $ip = getregkey($regiface, "DhcpIPAddress") || getregkey($regiface, "IPAddress"); $ns = getregkey($regiface, "NameServer") || - getregkey($regiface, "DhcpNameServer") || '' unless !$ip || ($ip =~ /0\.0\.0\.0/); - + getregkey($regiface, "DhcpNameServer") || '' + unless !$ip || ($ip =~ /0\.0\.0\.0/); + $nameservers .= " $ns" if $ns; - } - } - } + } + } + } if (!$nameservers) { $nameservers = $nt4nameservers; @@ -166,7 +167,7 @@ =head1 COPYRIGHT -Copyright (c) 1997-2002 Michael Fuhr. +Copyright (c) 1997-2002 Michael Fuhr. Portions Copyright (c) 2002-2004 Chris Reinhardt.
Hi Reini, I have your patch applied. Thanks! Could you look at RT#50883 , in which the patch was given that disabled the Cygwin resolver? Its original intention was to add nameserver learned from PPP to the nameservers list. Thanks, Willem
CC: net-dns-dev [...] nlnetlabs.nl
Subject: Re: [rt.cpan.org #60725] Enable Cygwin resolver
Date: Tue, 25 Oct 2011 11:58:57 -0600
To: bug-Net-DNS [...] rt.cpan.org
From: Rob Brown <bbb [...] cpan.org>
Reini, Thank you for your patch, but it's a little awkward to follow with all those goofy whitespace chunks in the original code. Willem, I guess this isn't really related specifically to this patch, but we have a "no trailing whitespace" policy which helps reduce clutter and makes patches easier to eyeball and reduces changes of version control conflicts and even saves a little hard drive. It's a minor issue but fairly easy to treat: find lib -name \*.pm | xargs perl -p -i -e 's/[ \t]+$//' All those TABs sprinkled all over are also a bit annoying, but one might argue that one TAB instead of 8 spaces could save hard drive at least. Plus, it's not quite as trivial to "fix" everything. So it'd probably be best to leave it how it is for now. :-D -- Rob Brown On Tue, Oct 25, 2011 at 6:39 AM, Willem Toorop via RT <bug-Net-DNS@rt.cpan.org> wrote: Show quoted text
>       Queue: Net-DNS >  Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=60725 > > > Hi Reini, > > I have your patch applied. Thanks! > > Could you look at RT#50883 , in which the patch was given that disabled > the Cygwin resolver? Its original intention was to add nameserver > learned from PPP to the nameservers list. > Thanks, > > Willem > >
RT-Send-CC: net-dns-dev [...] nlnetlabs.nl
Hi Reini, I have modified it so that the usage of Win32::IPHelper (and thus the Win32.pm codepath for Net::DNS::Resolver) may be chosen for Cygwin during build time. Default it checks if a version of Net::DNS is already installed and copies the setting from that. If installed freshly, the Cygwin codepath is chosen. I feel this is safest as it introduces the least possible chances for people already running Net::DNS. Closing ticket, -- Willem