r60276 - in /trunk/libsocket-getaddrinfo-perl: Build.PL Changes META.yml Makefile.PL debian/changelog debian/compat debian/control debian/copyright debian/source/ debian/source/format lib/Socket/GetAddrInfo.pm lib/Socket/GetAddrInfo.xs t/01getaddrinfo.t

ansgar-guest at users.alioth.debian.org ansgar-guest at users.alioth.debian.org
Wed Jul 14 02:42:39 UTC 2010


Author: ansgar-guest
Date: Wed Jul 14 02:42:33 2010
New Revision: 60276

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=60276
Log:
* New upstream release.
* Remove build-dep on perl (>= 5.10) | libmodule-build-perl:
  a build-dep on perl is enough as stable already has perl 5.10.
* Bump build-dep on libextutils-cchecker-perl to >= 0.04.
* Use debhelper compat level 8, bump build-dep on debhelper to >= 7.9.1.
* debian/copyright: Update years of copyright.
* Use source format 3.0 (quilt).
* Bump Standards-Version to 3.9.0 (no changes).
* Add myself to Uploaders.

Added:
    trunk/libsocket-getaddrinfo-perl/debian/source/
    trunk/libsocket-getaddrinfo-perl/debian/source/format
Modified:
    trunk/libsocket-getaddrinfo-perl/Build.PL
    trunk/libsocket-getaddrinfo-perl/Changes
    trunk/libsocket-getaddrinfo-perl/META.yml
    trunk/libsocket-getaddrinfo-perl/Makefile.PL
    trunk/libsocket-getaddrinfo-perl/debian/changelog
    trunk/libsocket-getaddrinfo-perl/debian/compat
    trunk/libsocket-getaddrinfo-perl/debian/control
    trunk/libsocket-getaddrinfo-perl/debian/copyright
    trunk/libsocket-getaddrinfo-perl/lib/Socket/GetAddrInfo.pm
    trunk/libsocket-getaddrinfo-perl/lib/Socket/GetAddrInfo.xs
    trunk/libsocket-getaddrinfo-perl/t/01getaddrinfo.t

Modified: trunk/libsocket-getaddrinfo-perl/Build.PL
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libsocket-getaddrinfo-perl/Build.PL?rev=60276&op=diff
==============================================================================
--- trunk/libsocket-getaddrinfo-perl/Build.PL (original)
+++ trunk/libsocket-getaddrinfo-perl/Build.PL Wed Jul 14 02:42:33 2010
@@ -5,21 +5,26 @@
 
 eval { require ExtUtils::CChecker; 1 } or
    die "OS unsupported - missing ExtUtils::CChecker";
+eval { ExtUtils::CChecker->VERSION( 0.04 ) } or
+   die "OS unsupported - ExtUtils::CChecker too old; need at least 0.04";
 
+my $cc = ExtUtils::CChecker->new();
+
+my $CAN_XS = 0;
 my $HAVE_SOCKADDR_SA_LEN;
 
-sub Configure
-{
+TRY_XS: {
    if( $ENV{NO_XS} ) {
       print "\$ENV{NO_XS} is set - XS code will be disabled\n";
-      return 0;
+      last TRY_XS;
    }
-
-   my $cc = ExtUtils::CChecker->new();
 
    print "\nDetecting if libc supports getaddrinfo()...\n";
 
-   my $gai_test = <<EOF;
+   last TRY_XS unless $cc->try_find_libs_for(
+      # Solaris et.al. use -lsocket or -lsocket -lnsl
+      libs => [ "", "socket", "socket nsl" ],
+      source => <<'EOF' );
 #include <stdlib.h>
 #include <sys/types.h>
 #include <sys/socket.h>
@@ -35,13 +40,15 @@
 }
 EOF
 
-   return 0 unless $cc->try_compile_run( source => $gai_test );
+   $CAN_XS = 1;
 
    print "\nLooks like the libc supports getaddrinfo()\n";
 
    print "Detecting if sockaddr has sa_len field...\n";
 
-   my $sa_len_test = <<EOF;
+   $cc->try_compile_run(
+      define => "HAVE_SOCKADDR_SA_LEN",
+      source => <<'EOF' );
 #include <stdlib.h>
 #include <sys/types.h>
 #include <sys/socket.h>
@@ -51,27 +58,19 @@
    return 0;
 }
 EOF
-
-   $HAVE_SOCKADDR_SA_LEN = $cc->try_compile_run( source => $sa_len_test );
-
-   return 1;
 }
 
-my $CAN_XS = Configure();
-
-my $build = Module::Build->new
-  (
+my $build = $cc->new_module_build(
    module_name => 'Socket::GetAddrInfo',
    dist_version_from => 'lib/Socket/GetAddrInfo.pm',
-   extra_compiler_flags => [ "-DHAVE_SOCKADDR_SA_LEN=$HAVE_SOCKADDR_SA_LEN" ],
    requires => {
       'XSLoader' => 0,
    },
    configure_requires => {
-      'ExtUtils::CChecker' => 0,
+      'ExtUtils::CChecker' => '0.04',
    },
    build_requires => {
-      'ExtUtils::CChecker' => 0,
+      'ExtUtils::CChecker' => '0.04',
       'Module::Build' => 0,
       'Module::Build::Compat' => 0,
       'Scalar::Util' => 0,
@@ -85,6 +84,6 @@
    create_readme  => 1,
 
    $CAN_XS ? () : ( xs_files => {} ),
-  );
+);
 
 $build->create_build_script;

Modified: trunk/libsocket-getaddrinfo-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libsocket-getaddrinfo-perl/Changes?rev=60276&op=diff
==============================================================================
--- trunk/libsocket-getaddrinfo-perl/Changes (original)
+++ trunk/libsocket-getaddrinfo-perl/Changes Wed Jul 14 02:42:33 2010
@@ -1,4 +1,10 @@
 Revision history for Socket-GetAddrInfo
+
+0.16    CHANGES:
+         * Accept undef as absent host/service name, as well as ""
+
+        BUGFIXES:
+         * Need -lsocket on some OSes; hunt it using ExtUtils::CChecker
 
 0.15    CHANGES:
          * Use XSLoader instead of DynaLoader

Modified: trunk/libsocket-getaddrinfo-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libsocket-getaddrinfo-perl/META.yml?rev=60276&op=diff
==============================================================================
--- trunk/libsocket-getaddrinfo-perl/META.yml (original)
+++ trunk/libsocket-getaddrinfo-perl/META.yml Wed Jul 14 02:42:33 2010
@@ -4,7 +4,7 @@
   - 'Paul Evans <leonerd at leonerd.org.uk>'
 build_requires:
   ExtUtils::CBuilder: 0
-  ExtUtils::CChecker: 0
+  ExtUtils::CChecker: 0.04
   Module::Build: 0
   Module::Build::Compat: 0
   Scalar::Util: 0
@@ -12,9 +12,9 @@
   Test::More: 0
   Test::Warn: 0
 configure_requires:
-  ExtUtils::CChecker: 0
+  ExtUtils::CChecker: 0.04
   Module::Build: 0.36
-generated_by: 'Module::Build version 0.3601'
+generated_by: 'Module::Build version 0.3607'
 license: perl
 meta-spec:
   url: http://module-build.sourceforge.net/META-spec-v1.4.html
@@ -23,9 +23,9 @@
 provides:
   Socket::GetAddrInfo:
     file: lib/Socket/GetAddrInfo.pm
-    version: 0.15
+    version: 0.16
 requires:
   XSLoader: 0
 resources:
   license: http://dev.perl.org/licenses/
-version: 0.15
+version: 0.16

Modified: trunk/libsocket-getaddrinfo-perl/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libsocket-getaddrinfo-perl/Makefile.PL?rev=60276&op=diff
==============================================================================
--- trunk/libsocket-getaddrinfo-perl/Makefile.PL (original)
+++ trunk/libsocket-getaddrinfo-perl/Makefile.PL Wed Jul 14 02:42:33 2010
@@ -1,4 +1,4 @@
-# Note: this file was auto-generated by Module::Build::Compat version 0.3601
+# Note: this file was auto-generated by Module::Build::Compat version 0.3607
     use Module::Build::Compat 0.02;
     
     Module::Build::Compat->run_build_pl(args => \@ARGV);

Modified: trunk/libsocket-getaddrinfo-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libsocket-getaddrinfo-perl/debian/changelog?rev=60276&op=diff
==============================================================================
--- trunk/libsocket-getaddrinfo-perl/debian/changelog (original)
+++ trunk/libsocket-getaddrinfo-perl/debian/changelog Wed Jul 14 02:42:33 2010
@@ -1,3 +1,17 @@
+libsocket-getaddrinfo-perl (0.16-1) unstable; urgency=low
+
+  * New upstream release.
+  * Remove build-dep on perl (>= 5.10) | libmodule-build-perl:
+    a build-dep on perl is enough as stable already has perl 5.10.
+  * Bump build-dep on libextutils-cchecker-perl to >= 0.04.
+  * Use debhelper compat level 8, bump build-dep on debhelper to >= 7.9.1.
+  * debian/copyright: Update years of copyright.
+  * Use source format 3.0 (quilt).
+  * Bump Standards-Version to 3.9.0 (no changes).
+  * Add myself to Uploaders.
+
+ -- Ansgar Burchardt <ansgar at 43-1.org>  Wed, 14 Jul 2010 11:39:59 +0900
+
 libsocket-getaddrinfo-perl (0.15-1) unstable; urgency=low
 
   * New upstream release

Modified: trunk/libsocket-getaddrinfo-perl/debian/compat
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libsocket-getaddrinfo-perl/debian/compat?rev=60276&op=diff
==============================================================================
--- trunk/libsocket-getaddrinfo-perl/debian/compat (original)
+++ trunk/libsocket-getaddrinfo-perl/debian/compat Wed Jul 14 02:42:33 2010
@@ -1,1 +1,1 @@
-7
+8

Modified: trunk/libsocket-getaddrinfo-perl/debian/control
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libsocket-getaddrinfo-perl/debian/control?rev=60276&op=diff
==============================================================================
--- trunk/libsocket-getaddrinfo-perl/debian/control (original)
+++ trunk/libsocket-getaddrinfo-perl/debian/control Wed Jul 14 02:42:33 2010
@@ -1,13 +1,12 @@
 Source: libsocket-getaddrinfo-perl
 Section: perl
 Priority: optional
-Build-Depends: perl (>= 5.10) | libmodule-build-perl,
- debhelper (>= 7.2.10), libtest-exception-perl, libtest-warn-perl,
- libtest-pod-perl, libextutils-cchecker-perl
+Build-Depends: perl, debhelper (>= 7.9.1), libtest-exception-perl,
+ libtest-warn-perl, libtest-pod-perl, libextutils-cchecker-perl (>= 0.04)
 Maintainer: Debian Perl Group <pkg-perl-maintainers at lists.alioth.debian.org>
 Uploaders: Jonathan Yu <jawnsy at cpan.org>,
- Nathan Handler <nhandler at ubuntu.com>
-Standards-Version: 3.8.4
+ Nathan Handler <nhandler at ubuntu.com>, Ansgar Burchardt <ansgar at 43-1.org>
+Standards-Version: 3.9.0
 Homepage: http://search.cpan.org/dist/Socket-GetAddrInfo/
 Vcs-Svn: svn://svn.debian.org/pkg-perl/trunk/libsocket-getaddrinfo-perl/
 Vcs-Browser: http://svn.debian.org/viewsvn/pkg-perl/trunk/libsocket-getaddrinfo-perl/

Modified: trunk/libsocket-getaddrinfo-perl/debian/copyright
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libsocket-getaddrinfo-perl/debian/copyright?rev=60276&op=diff
==============================================================================
--- trunk/libsocket-getaddrinfo-perl/debian/copyright (original)
+++ trunk/libsocket-getaddrinfo-perl/debian/copyright Wed Jul 14 02:42:33 2010
@@ -3,8 +3,7 @@
 Source: http://search.cpan.org/dist/Socket-GetAddrInfo/
 Name: Socket-GetAddrInfo
 
-Files: *
-Copyright: 2010, Paul Evans <leonerd at leonerd.org.uk>
+Copyright: 2007-2010, Paul Evans <leonerd at leonerd.org.uk>
 License: Artistic or GPL-1+
 
 Files: debian/*

Added: trunk/libsocket-getaddrinfo-perl/debian/source/format
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libsocket-getaddrinfo-perl/debian/source/format?rev=60276&op=file
==============================================================================
--- trunk/libsocket-getaddrinfo-perl/debian/source/format (added)
+++ trunk/libsocket-getaddrinfo-perl/debian/source/format Wed Jul 14 02:42:33 2010
@@ -1,0 +1,1 @@
+3.0 (quilt)

Modified: trunk/libsocket-getaddrinfo-perl/lib/Socket/GetAddrInfo.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libsocket-getaddrinfo-perl/lib/Socket/GetAddrInfo.pm?rev=60276&op=diff
==============================================================================
--- trunk/libsocket-getaddrinfo-perl/lib/Socket/GetAddrInfo.pm (original)
+++ trunk/libsocket-getaddrinfo-perl/lib/Socket/GetAddrInfo.pm Wed Jul 14 02:42:33 2010
@@ -1,7 +1,7 @@
 #  You may distribute under the terms of either the GNU General Public License
 #  or the Artistic License (the same terms as Perl itself)
 #
-#  (C) Paul Evans, 2007-2009 -- leonerd at leonerd.org.uk
+#  (C) Paul Evans, 2007-2010 -- leonerd at leonerd.org.uk
 
 package Socket::GetAddrInfo;
 
@@ -15,7 +15,7 @@
 my %errstr;
 
 BEGIN {
-   our $VERSION = "0.15";
+   our $VERSION = "0.16";
 
    our @EXPORT = qw(
       getaddrinfo

Modified: trunk/libsocket-getaddrinfo-perl/lib/Socket/GetAddrInfo.xs
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libsocket-getaddrinfo-perl/lib/Socket/GetAddrInfo.xs?rev=60276&op=diff
==============================================================================
--- trunk/libsocket-getaddrinfo-perl/lib/Socket/GetAddrInfo.xs (original)
+++ trunk/libsocket-getaddrinfo-perl/lib/Socket/GetAddrInfo.xs Wed Jul 14 02:42:33 2010
@@ -1,7 +1,7 @@
 /*  You may distribute under the terms of either the GNU General Public License
  *  or the Artistic License (the same terms as Perl itself)
  *
- *  (C) Paul Evans, 2008,2009 -- leonerd at leonerd.org.uk
+ *  (C) Paul Evans, 2008-2010 -- leonerd at leonerd.org.uk
  */
 
 #include "EXTERN.h"
@@ -111,12 +111,14 @@
   setup_constants();
 
 void
-getaddrinfo(host, service, hints=NULL)
-    char *host
-    char *service
+getaddrinfo(host=NULL, service=NULL, hints=NULL)
+    SV   *host
+    SV   *service
     SV   *hints
 
   PREINIT:
+    char *hostname = NULL;
+    char *servicename = NULL;
     struct addrinfo hints_s = { 0 };
     struct addrinfo *res;
     struct addrinfo *res_iter;
@@ -124,6 +126,12 @@
     int n_res;
 
   PPCODE:
+    if(SvOK(host) && SvCUR(host))
+      hostname = SvPV_nolen(host);
+
+    if(SvOK(service) && SvCUR(service))
+      servicename = SvPV_nolen(service);
+
     if(hints && SvOK(hints)) {
       HV *hintshash;
       SV **valp;
@@ -143,7 +151,7 @@
         hints_s.ai_protocol = SvIV(*valp);
     }
 
-    err = getaddrinfo(host[0] ? host : NULL, service[0] ? service : NULL, &hints_s, &res);
+    err = getaddrinfo(hostname, servicename, &hints_s, &res);
 
     XPUSHs(err_to_SV(err));
 
@@ -195,7 +203,7 @@
      * not be due to SvOOK */
     Newx(sa, addr_len, char);
     Copy(SvPV_nolen(addr), sa, addr_len, char);
-#if HAVE_SOCKADDR_SA_LEN
+#ifdef HAVE_SOCKADDR_SA_LEN
     ((struct sockaddr *)sa)->sa_len = addr_len;
 #endif
 

Modified: trunk/libsocket-getaddrinfo-perl/t/01getaddrinfo.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libsocket-getaddrinfo-perl/t/01getaddrinfo.t?rev=60276&op=diff
==============================================================================
--- trunk/libsocket-getaddrinfo-perl/t/01getaddrinfo.t (original)
+++ trunk/libsocket-getaddrinfo-perl/t/01getaddrinfo.t Wed Jul 14 02:42:33 2010
@@ -2,7 +2,7 @@
 
 use strict;
 
-use Test::More tests => 24;
+use Test::More tests => 28;
 use Test::Exception;
 
 use Socket::GetAddrInfo qw( :newapi getaddrinfo AI_NUMERICHOST );
@@ -97,10 +97,19 @@
 is_sinaddr( $res[0]->{addr}, 80, inet_aton( "127.0.0.1" ),
    '$res[0] addr is {"127.0.0.1", 0}' );
 
+# Check actual IV integers work just as well as PV strings
+( $err, @res ) = getaddrinfo( "127.0.0.1", 80, { socktype => SOCK_STREAM } );
+is_err( $err, 0,  '$err == 0 for host=127.0.0.1/service=80/socktype=STREAM' );
+is_sinaddr( $res[0]->{addr}, 80, inet_aton( "127.0.0.1" ),
+   '$res[0] addr is {"127.0.0.1", 0}' );
+
 ( $err, @res ) = getaddrinfo( "127.0.0.1", "" );
 is_err( $err, 0,  '$err == 0 for host=127.0.0.1' );
 # Might get more than one; e.g. different socktypes
 ok( scalar @res > 0, '@res has results' );
+
+( $err, @res ) = getaddrinfo( "127.0.0.1", undef );
+is_err( $err, 0,  '$err == 0 for host=127.0.0.1' );
 
 # Just pick the first one
 is( $res[0]->{family}, AF_INET,
@@ -119,6 +128,9 @@
    '$res[0] socktype is SOCK_STREAM' );
 ok( $res[0]->{protocol} == 0 || $res[0]->{protocol} == IPPROTO_TCP,
    '$res[0] protocol is 0 or IPPROTO_TCP' );
+
+( $err, @res ) = getaddrinfo( undef, "80", { family => AF_INET, socktype => SOCK_STREAM } );
+is_err( $err, 0,  '$err == 0 for service=80/family=AF_INET/socktype=STREAM' );
 
 # Now some tests of a few well-known internet hosts
 




More information about the Pkg-perl-cvs-commits mailing list