gnu: python-babel: Update to 2.7.0.
[guix.git] / gnu / packages / patches / perl-net-dns-resolver-programmable-fix.patch
blob371693dca1a0f1b4a117a453817b9da6c86df2f5
1 perl-net-dns-resolver-programmable used the undocumented and internal
2 method Net::DNS::rcodesbyname [0], and that interface is no longer
3 exposed.
5 This patch, copied from [1], makes the program check for the existence
6 of the method before trying to use it.
8 [0]
9 <https://rt.cpan.org/Public/Bug/Display.html?id=95901>
11 [1]
12 <https://rt.cpan.org/Public/Bug/Display.html?id=95901#txn-1575108>
14 diff --git a/lib/Net/DNS/Resolver/Programmable.pm b/lib/Net/DNS/Resolver/Programmable.pm
15 index 1af72ce..e09a2f0 100644
16 --- a/lib/Net/DNS/Resolver/Programmable.pm
17 +++ b/lib/Net/DNS/Resolver/Programmable.pm
18 @@ -203,8 +203,10 @@ sub send {
19 if (defined(my $resolver_code = $self->{resolver_code})) {
20 ($result, $aa, @answer_rrs) = $resolver_code->($domain, $rr_type, $class);
23 - if (not defined($result) or defined($Net::DNS::rcodesbyname{$result})) {
25 + if (not defined($result)
26 + or defined($Net::DNS::Parameters::rcodebyname{$result})
27 + or defined($Net::DNS::rcodesbyname{$result})) {
28 # Valid RCODE, return a packet:
30 $aa = TRUE if not defined($aa);