Hello community,

here is the log from the commit of package perl-Net-Whois-Raw for 
openSUSE:Factory checked in at 2020-02-27 14:38:20
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/perl-Net-Whois-Raw (Old)
 and      /work/SRC/openSUSE:Factory/.perl-Net-Whois-Raw.new.26092 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "perl-Net-Whois-Raw"

Thu Feb 27 14:38:20 2020 rev:41 rq:779681 version:2.99027

Changes:
--------
--- /work/SRC/openSUSE:Factory/perl-Net-Whois-Raw/perl-Net-Whois-Raw.changes    
2019-11-11 13:00:46.145714383 +0100
+++ 
/work/SRC/openSUSE:Factory/.perl-Net-Whois-Raw.new.26092/perl-Net-Whois-Raw.changes
 2020-02-27 14:38:46.986211181 +0100
@@ -1,0 +2,10 @@
+Tue Feb 25 03:09:47 UTC 2020 -  <timueller+p...@suse.de>
+
+- updated to 2.99027
+   see /usr/share/doc/packages/perl-Net-Whois-Raw/Changes
+
+  2.99027  Feb 24 2020 Alexander Nalobin
+      - pwhois script refactoring
+      - Can pass arbitrary query part to pwhois script
+
+-------------------------------------------------------------------

Old:
----
  Net-Whois-Raw-2.99026.tar.gz

New:
----
  Net-Whois-Raw-2.99027.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ perl-Net-Whois-Raw.spec ++++++
--- /var/tmp/diff_new_pack.UzuPCz/_old  2020-02-27 14:38:49.250215851 +0100
+++ /var/tmp/diff_new_pack.UzuPCz/_new  2020-02-27 14:38:49.254215859 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package perl-Net-Whois-Raw
 #
-# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2020 SUSE LINUX GmbH, Nuernberg, Germany.
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,7 +17,7 @@
 
 
 Name:           perl-Net-Whois-Raw
-Version:        2.99026
+Version:        2.99027
 Release:        0
 %define cpan_name Net-Whois-Raw
 Summary:        Get Whois information of domains and IP addresses

++++++ Net-Whois-Raw-2.99026.tar.gz -> Net-Whois-Raw-2.99027.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Net-Whois-Raw-2.99026/Changes 
new/Net-Whois-Raw-2.99027/Changes
--- old/Net-Whois-Raw-2.99026/Changes   2019-10-25 04:32:01.000000000 +0200
+++ new/Net-Whois-Raw-2.99027/Changes   2020-02-24 08:58:09.000000000 +0100
@@ -1,5 +1,9 @@
 Revision history for Perl module Net::Whois::Raw.
 
+2.99027  Feb 24 2020 Alexander Nalobin
+    - pwhois script refactoring
+    - Can pass arbitrary query part to pwhois script
+
 2.99026  Oct 25 2019 Alexander Nalobin
     - Change whois.rightside.co whois server to whois.donuts.co
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Net-Whois-Raw-2.99026/LICENSE 
new/Net-Whois-Raw-2.99027/LICENSE
--- old/Net-Whois-Raw-2.99026/LICENSE   2019-10-25 04:32:01.000000000 +0200
+++ new/Net-Whois-Raw-2.99027/LICENSE   2020-02-24 08:58:09.000000000 +0100
@@ -1,4 +1,4 @@
-This software is copyright (c) 2002-2019 by Alexander Nalobin.
+This software is copyright (c) 2002-2020 by Alexander Nalobin.
 
 This is free software; you can redistribute it and/or modify it under
 the same terms as the Perl 5 programming language system itself.
@@ -12,7 +12,7 @@
 
 --- The GNU General Public License, Version 1, February 1989 ---
 
-This software is Copyright (c) 2002-2019 by Alexander Nalobin.
+This software is Copyright (c) 2002-2020 by Alexander Nalobin.
 
 This is free software, licensed under:
 
@@ -272,7 +272,7 @@
 
 --- The Artistic License 1.0 ---
 
-This software is Copyright (c) 2002-2019 by Alexander Nalobin.
+This software is Copyright (c) 2002-2020 by Alexander Nalobin.
 
 This is free software, licensed under:
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Net-Whois-Raw-2.99026/META.json 
new/Net-Whois-Raw-2.99027/META.json
--- old/Net-Whois-Raw-2.99026/META.json 2019-10-25 04:32:01.000000000 +0200
+++ new/Net-Whois-Raw-2.99027/META.json 2020-02-24 08:58:09.000000000 +0100
@@ -59,7 +59,7 @@
          "web" : "https://github.com/regru/Net-Whois-Raw";
       }
    },
-   "version" : "2.99026",
+   "version" : "2.99027",
    "x_generated_by_perl" : "v5.18.2",
    "x_serialization_backend" : "JSON::XS version 3.04"
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Net-Whois-Raw-2.99026/META.yml 
new/Net-Whois-Raw-2.99027/META.yml
--- old/Net-Whois-Raw-2.99026/META.yml  2019-10-25 04:32:01.000000000 +0200
+++ new/Net-Whois-Raw-2.99027/META.yml  2020-02-24 08:58:09.000000000 +0100
@@ -36,6 +36,6 @@
 resources:
   bugtracker: https://github.com/regru/Net-Whois-Raw/issues
   repository: git://github.com/regru/Net-Whois-Raw.git
-version: 2.99026
+version: 2.99027
 x_generated_by_perl: v5.18.2
 x_serialization_backend: 'YAML::Tiny version 1.56'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Net-Whois-Raw-2.99026/Makefile.PL 
new/Net-Whois-Raw-2.99027/Makefile.PL
--- old/Net-Whois-Raw-2.99026/Makefile.PL       2019-10-25 04:32:01.000000000 
+0200
+++ new/Net-Whois-Raw-2.99027/Makefile.PL       2020-02-24 08:58:09.000000000 
+0100
@@ -42,7 +42,7 @@
     "Test::More" => 0,
     "Test::RequiresInternet" => 0
   },
-  "VERSION" => "2.99026",
+  "VERSION" => "2.99027",
   "test" => {
     "TESTS" => "t/*.t"
   }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Net-Whois-Raw-2.99026/bin/pwhois 
new/Net-Whois-Raw-2.99027/bin/pwhois
--- old/Net-Whois-Raw-2.99026/bin/pwhois        2019-10-25 04:32:01.000000000 
+0200
+++ new/Net-Whois-Raw-2.99027/bin/pwhois        2020-02-24 08:58:09.000000000 
+0100
@@ -11,6 +11,9 @@
 use Net::IDN::Punycode qw( :all );
 use utf8;
 
+binmode STDOUT, ':encoding(UTF-8)';
+binmode STDERR, ':encoding(UTF-8)';
+
 my $help;
 my $do_strip;
 my $do_strip_more;
@@ -39,8 +42,8 @@
     'return_all|A'     => \$return_all,
 ) or die;
 
-if ($help || !@ARGV) {
-    print <<EOM;
+if ( $help || !@ARGV ) {
+    print q{
 Usage: $0 [ -s ] [ -c ] [ -d ] [ -T <timeout> ] [ -a <src_ip> ] [ -t ] [ -F | 
-L | -A ] <domain> [ <server> ]
 
 Switches:
@@ -53,7 +56,7 @@
 -F     returns results of the first query of recursive whois requests
 -L     returns results of the last query of recursive whois requests (the 
default)
 -A     returns results of the all queries of recursive whois requests
-EOM
+};
     exit;
 }
 
@@ -61,10 +64,10 @@
 $Net::Whois::Raw::OMIT_MSG   = $do_strip     ? 1 : 0;
 $Net::Whois::Raw::CHECK_FAIL = $do_checkfail ? 1 : 0;
 $Net::Whois::Raw::TIMEOUT    = $timeout;
-@Net::Whois::Raw::SRC_IPS    = @source_addresses if @source_addresses;
+@Net::Whois::Raw::SRC_IPS    = @source_addresses  if @source_addresses;
 
-if ($enable_caching) {
-    if ($^O eq 'MSWin32') {
+if ( $enable_caching ) {
+    if ( $^O eq 'MSWin32' ) {
         $Net::Whois::Raw::CACHE_DIR = $ENV{TEMP} || "C:\\temp";
     }
     else {
@@ -77,54 +80,56 @@
 
 my ( $input_cp, $output_cp ) = detect_encodings();
 
-my $dom = $ARGV[0];
-my $server = $ARGV[1];
+my ( $query, $server ) = @ARGV;
+
+$query = decode_query( $query, $input_cp );
 
-$dom = prepare_domain($dom, $input_cp);
+# Split domain name and optional part prepended by '?' character.
+my ( $dname, $options ) = split /[?]/, $query;
 
-unless (validate_domain($dom)) {
-    print encode_output("\nIncorrect domain name:\n$dom\n", $output_cp);
+unless ( validate_domain_name( $dname ) ) {
+    print encode_output( "\nIncorrect dname:\n$dname\n", $output_cp );
     exit -1;
 }
 
-$dom = to_punycode($dom);
+$query = to_punycode( $dname );
 
-eval {
-    my ($result, $result_server);
-    my $which_whois =
-        $return_first ? 'QRY_FIRST' :
-        $return_all   ? 'QRY_ALL'   : 'QRY_LAST';
+$query .= '?' . $options  if defined $options;
 
-    ($result, $result_server) =
-        Net::Whois::Raw::get_whois( $dom, $server, $which_whois );
+my ( $result, $result_server );
+my $which_whois =
+    $return_first ? 'QRY_FIRST' :
+    $return_all   ? 'QRY_ALL'   : 'QRY_LAST';
 
-    if ($result and ref $result eq 'ARRAY') {
-        make_output($_->{text}, $_->{srv}, $output_cp) for @{$result};
-    }
-    elsif ($result) {
-        make_output($result, $result_server, $output_cp);
-    }
-    else {
-        print STDERR "Failed.\n";
-    }
-};
+eval {
+    ( $result, $result_server ) = Net::Whois::Raw::get_whois( $query, $server, 
$which_whois );
 
-if ($@) {
+    1;
+} or do {
     my $err = $@;
 
     $err =~ s/\s+at \S+ line \d+\.$//;
     print "\nWhois information could not be fetched:\n$err\n";
     exit -1;
+};
+
+if ( $result && ref $result eq 'ARRAY' ) {
+    make_output( $_->{text}, $_->{srv}, $output_cp ) for @$result;
+}
+elsif ( $result ) {
+    make_output( $result, $result_server, $output_cp );
+}
+else {
+    print STDERR "Failed.\n";
 }
 
 # Prepare and print output
 sub make_output {
-    my ($result, $server, $cp) = @_;
+    my ( $result, $server, $cp ) = @_;
 
     $result = encode_output( $result, $cp );
 
-    print "[$server]\n";
-    print $result, "\n";
+    print "[$server]\n", $result, "\n";
 }
 
 # Encode output
@@ -146,22 +151,28 @@
     my ( $input_cp, $output_cp );
 
     if ( $^O =~ /Win/ ) {
+
         # Read encoding from registry
         require Win32API::Registry;
         Win32API::Registry->import( qw( :ALL ) );
 
         my ( $key, $type, $data );
         RegOpenKeyEx( HKEY_LOCAL_MACHINE(), 
'SYSTEM\\CurrentControlSet\\Control\\Nls\\CodePage', 0, KEY_READ(), $key )
-            or die "Can't read system encodings from registry: 
".regLastError();
+            or die "Can't read system encodings from registry: " . 
regLastError();
+
         RegQueryValueEx( $key, 'ACP', [], $type, $data, [] )
-            or die "Can't read system encodings from registry: 
".regLastError();
-        $input_cp = 'cp'.$data;
+            or die "Can't read system encodings from registry: " . 
regLastError();
+        $input_cp = 'cp' . $data;
+
         RegQueryValueEx( $key, 'OEMCP', [], $type, $data, [] )
-            or die "Can't read system encodings from registry: 
".regLastError();
-        $output_cp = 'cp'.$data;
-    } else {
+            or die "Can't read system encodings from registry: " . 
regLastError();
+
+        $output_cp = 'cp' . $data;
+    }
+    else {
         # Read encoding from environment
         my $cp = $ENV{LANG};
+
         if ( $cp ) {
             $cp =~ s/^[a-z]{2}_[A-Z]{2}[.]//;
         }
@@ -175,55 +186,45 @@
     return $input_cp, $output_cp;
 }
 
-# Prepare domain name
-sub prepare_domain {
-    my ($dom, $input_cp) = @_;
+sub decode_query {
+    my ( $query, $input_cp ) = @_;
 
-    # Decode command-line input
-    $dom = decode($input_cp, $dom);
+    $query = decode( $input_cp, $query );
 
     # Lowercase latin and cyrillic characters
-    $dom =~ tr/A-ZА-ЯЁ\xAA\xA5\xB2\xAF/a-zа-яё\xBA\xB4\xB3\xBF/;
+    $query =~ tr/A-ZА-ЯЁ\xAA\xA5\xB2\xAF/a-zа-яё\xBA\xB4\xB3\xBF/;
 
-    return $dom;
+    return $query;
 }
 
 # Decode domain name to punycode if needed
 sub to_punycode {
-    my ($dom) = @_;
+    my ( $dname ) = @_;
 
-    unless ($dom =~ /^[a-z0-9.\-]*$/) {
-        # Convert to Punycode
-        my @parts;
-        foreach my $part (split /\./, $dom) {
-            $part = 'xn--'.Net::IDN::Punycode::encode_punycode( $part )
-                unless $part =~ /^[a-z0-9.-]*$/;
-            push @parts, $part;
-        }
-        $dom = join('.', @parts);
-    }
+    return $dname  if $dname =~ /^[a-z0-9.\-]*$/;
 
-    return $dom;
+    return join '.', 
+           map { /^[a-z0-9.-]*$/ ? $_ : 'xn--' . 
Net::IDN::Punycode::encode_punycode( $_ ) }
+           split /[.]/, $dname;
 }
 
-# Validate domain name
-sub validate_domain {
-    my ($dom) = @_;
+sub validate_domain_name {
+    my ( $dname ) = @_;
 
-    return 0 unless $dom;
+    return 0  unless $dname;
 
-    $dom =~ /(.+?)\.([^.]+)$/;
-    my ($name, $tld) = ($1, $2);
+    $dname =~ /(.+?)\.([^.]+)$/;
+    my ( $name, $tld ) = ( $1, $2 );
 
     # query with tld only
-    return 1 unless $name;
+    return 1  unless $name;
 
-    return 0 if $name =~ /^-/;
-    return 0 if $name =~ /-$/;
-    return 0 if $name =~ /^..--/ && $dom !~ /^xn--/;
+    return 0  if $name =~ /^-/;
+    return 0  if $name =~ /-$/;
+    return 0  if $name =~ /^..--/ && $dname !~ /^xn--/;
 
     # Only latin and cyrillic characters allowed now
-    # return 0 if $dom =~ 
m/[^-a-z0-9\.ёа-я\xAA\xBA\xB4\xB2\xB3\xAF\xBF\xA1\xA2]/;
+    # return 0 if $dname =~ 
m/[^-a-z0-9\.ёа-я\xAA\xBA\xB4\xB2\xB3\xAF\xBF\xA1\xA2]/;
 
     return 1;
 }
@@ -240,7 +241,7 @@
 
 =head1 VERSION
 
-version 2.99026
+version 2.99027
 
 =head1 SYNOPSIS
 
@@ -275,8 +276,9 @@
 =head1 AUTHORS
 
 Ariel Brosh B<sc...@cpan.org>
+Walery Studennikov B<desp...@cpan.org>
 
-Current Maintainer: Walery Studennikov B<desp...@cpan.org>
+Current Maintainer: Alexander Nalobin B<nalo...@cpan.org>
 
 =head1 SEE ALSO
 
@@ -288,7 +290,7 @@
 
 =head1 COPYRIGHT AND LICENSE
 
-This software is copyright (c) 2002-2019 by Alexander Nalobin.
+This software is copyright (c) 2002-2020 by Alexander Nalobin.
 
 This is free software; you can redistribute it and/or modify it under
 the same terms as the Perl 5 programming language system itself.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Net-Whois-Raw-2.99026/dist.ini 
new/Net-Whois-Raw-2.99027/dist.ini
--- old/Net-Whois-Raw-2.99026/dist.ini  2019-10-25 04:32:01.000000000 +0200
+++ new/Net-Whois-Raw-2.99027/dist.ini  2020-02-24 08:58:09.000000000 +0100
@@ -2,9 +2,9 @@
 author  = Alexander Nalobin <alexan...@nalobin.ru>
 license = Perl_5
 copyright_holder = Alexander Nalobin
-copyright_year   = 2002-2019
+copyright_year   = 2002-2020
 
-version = 2.99026
+version = 2.99027
 
 [@Filter]
 -bundle = @Basic
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Net-Whois-Raw-2.99026/lib/Net/Whois/Raw/Common.pm 
new/Net-Whois-Raw-2.99027/lib/Net/Whois/Raw/Common.pm
--- old/Net-Whois-Raw-2.99026/lib/Net/Whois/Raw/Common.pm       2019-10-25 
04:32:01.000000000 +0200
+++ new/Net-Whois-Raw-2.99027/lib/Net/Whois/Raw/Common.pm       2020-02-24 
08:58:09.000000000 +0100
@@ -1,5 +1,5 @@
 package Net::Whois::Raw::Common;
-$Net::Whois::Raw::Common::VERSION = '2.99026';
+$Net::Whois::Raw::Common::VERSION = '2.99027';
 # ABSTRACT: Helper for Net::Whois::Raw.
 
 use Encode;
@@ -616,7 +616,7 @@
 
 =head1 VERSION
 
-version 2.99026
+version 2.99027
 
 =head1 AUTHOR
 
@@ -624,7 +624,7 @@
 
 =head1 COPYRIGHT AND LICENSE
 
-This software is copyright (c) 2002-2019 by Alexander Nalobin.
+This software is copyright (c) 2002-2020 by Alexander Nalobin.
 
 This is free software; you can redistribute it and/or modify it under
 the same terms as the Perl 5 programming language system itself.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Net-Whois-Raw-2.99026/lib/Net/Whois/Raw/Data.pm 
new/Net-Whois-Raw-2.99027/lib/Net/Whois/Raw/Data.pm
--- old/Net-Whois-Raw-2.99026/lib/Net/Whois/Raw/Data.pm 2019-10-25 
04:32:01.000000000 +0200
+++ new/Net-Whois-Raw-2.99027/lib/Net/Whois/Raw/Data.pm 2020-02-24 
08:58:09.000000000 +0100
@@ -1,5 +1,5 @@
 package Net::Whois::Raw::Data;
-$Net::Whois::Raw::Data::VERSION = '2.99026';
+$Net::Whois::Raw::Data::VERSION = '2.99027';
 # ABSTRACT: Config for Net::Whois::Raw.
 
 use utf8;
@@ -4585,7 +4585,7 @@
 
 =head1 VERSION
 
-version 2.99026
+version 2.99027
 
 =head1 AUTHOR
 
@@ -4593,7 +4593,7 @@
 
 =head1 COPYRIGHT AND LICENSE
 
-This software is copyright (c) 2002-2019 by Alexander Nalobin.
+This software is copyright (c) 2002-2020 by Alexander Nalobin.
 
 This is free software; you can redistribute it and/or modify it under
 the same terms as the Perl 5 programming language system itself.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Net-Whois-Raw-2.99026/lib/Net/Whois/Raw.pm 
new/Net-Whois-Raw-2.99027/lib/Net/Whois/Raw.pm
--- old/Net-Whois-Raw-2.99026/lib/Net/Whois/Raw.pm      2019-10-25 
04:32:01.000000000 +0200
+++ new/Net-Whois-Raw-2.99027/lib/Net/Whois/Raw.pm      2020-02-24 
08:58:09.000000000 +0100
@@ -1,5 +1,5 @@
 package Net::Whois::Raw;
-$Net::Whois::Raw::VERSION = '2.99026';
+$Net::Whois::Raw::VERSION = '2.99027';
 # ABSTRACT: Get Whois information of domains and IP addresses.
 
 require 5.008_001;
@@ -481,7 +481,7 @@
 
 =head1 VERSION
 
-version 2.99026
+version 2.99027
 
 =head1 SYNOPSIS
 
@@ -566,7 +566,7 @@
 
 =item whois( DOMAIN [, SRV [, WHICH_WHOIS]] )
 
-Returns Whois information for C<DOMAIN>.
+Returns Whois information for C<DOMAIN> in punycode.
 Without C<SRV> argument default Whois server for specified domain name
 zone will be used. Use 'www_whois' as server name to force
 WHOIS querying via HTTP (only few TLDs are supported in HTTP queries).
@@ -719,7 +719,7 @@
 
 =head1 COPYRIGHT AND LICENSE
 
-This software is copyright (c) 2002-2019 by Alexander Nalobin.
+This software is copyright (c) 2002-2020 by Alexander Nalobin.
 
 This is free software; you can redistribute it and/or modify it under
 the same terms as the Perl 5 programming language system itself.


Reply via email to