r33030 - in /trunk/libnet-ssh2-perl: Changes MANIFEST META.yml Makefile.PL SSH2.xs TODO debian/README.source debian/changelog debian/control lib/Net/SSH2.pm t/Net-SSH2.t typemap

ryan52-guest at users.alioth.debian.org ryan52-guest at users.alioth.debian.org
Sat Apr 11 05:07:07 UTC 2009


Author: ryan52-guest
Date: Sat Apr 11 05:07:01 2009
New Revision: 33030

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=33030
Log:
* New upstream release
* Debian Policy 3.8.1
* Add debian/README.source to document quilt usage, as required by
  Debian Policy since 3.8.0.

Added:
    trunk/libnet-ssh2-perl/TODO
      - copied unchanged from r33029, branches/upstream/libnet-ssh2-perl/current/TODO
    trunk/libnet-ssh2-perl/debian/README.source
Modified:
    trunk/libnet-ssh2-perl/Changes
    trunk/libnet-ssh2-perl/MANIFEST
    trunk/libnet-ssh2-perl/META.yml
    trunk/libnet-ssh2-perl/Makefile.PL
    trunk/libnet-ssh2-perl/SSH2.xs
    trunk/libnet-ssh2-perl/debian/changelog
    trunk/libnet-ssh2-perl/debian/control
    trunk/libnet-ssh2-perl/lib/Net/SSH2.pm
    trunk/libnet-ssh2-perl/t/Net-SSH2.t
    trunk/libnet-ssh2-perl/typemap

Modified: trunk/libnet-ssh2-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libnet-ssh2-perl/Changes?rev=33030&op=diff
==============================================================================
--- trunk/libnet-ssh2-perl/Changes (original)
+++ trunk/libnet-ssh2-perl/Changes Sat Apr 11 05:07:01 2009
@@ -2,6 +2,9 @@
 
 Developer/maintainer: David B. Robins <dbrobins at cpan.org>.
 Project started 2005-10-23 in Redmond, Washington, USA.
+
+0.19  2009-04-11 01:03:39
+        - Updated for perl 5.10 and 5.6 compatibility.
 
 0.18  2007-11-10  dbr  (svn revision 56)
         - Note version change: synced to libssh2.  Should be compatible with

Modified: trunk/libnet-ssh2-perl/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libnet-ssh2-perl/MANIFEST?rev=33030&op=diff
==============================================================================
--- trunk/libnet-ssh2-perl/MANIFEST (original)
+++ trunk/libnet-ssh2-perl/MANIFEST Sat Apr 11 05:07:01 2009
@@ -17,3 +17,4 @@
 fallback/const-c.inc
 fallback/const-xs.inc
 META.yml                                 Module meta-data (added by MakeMaker)
+TODO

Modified: trunk/libnet-ssh2-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libnet-ssh2-perl/META.yml?rev=33030&op=diff
==============================================================================
--- trunk/libnet-ssh2-perl/META.yml (original)
+++ trunk/libnet-ssh2-perl/META.yml Sat Apr 11 05:07:01 2009
@@ -1,13 +1,24 @@
-# http://module-build.sourceforge.net/META-spec.html
-#XXXXXXX This is a prototype!!!  It will change in the future!!! XXXXX#
-name:         Net-SSH2
-version:      0.18
-version_from: lib/Net/SSH2.pm
-installdirs:  site
+--- #YAML:1.0
+name:               Net-SSH2
+version:            0.19
+abstract:           Support for the SSH 2 protocol via libssh2.
+author:
+    - David B. Robins <dbrobins at cpan.org>
+license:            unknown
+distribution_type:  module
+configure_requires:
+    ExtUtils::MakeMaker:  0
+build_requires:
+    ExtUtils::MakeMaker:  0
 requires:
-    File::Basename:                0
-    IO::File:                      0
-    Socket:                        0
-
-distribution_type: module
-generated_by: ExtUtils::MakeMaker version 6.30
+    File::Basename:  0
+    IO::File:        0
+    Socket:          0
+no_index:
+    directory:
+        - t
+        - inc
+generated_by:       ExtUtils::MakeMaker version 6.50
+meta-spec:
+    url:      http://module-build.sourceforge.net/META-spec-v1.4.html
+    version:  1.4

Modified: trunk/libnet-ssh2-perl/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libnet-ssh2-perl/Makefile.PL?rev=33030&op=diff
==============================================================================
--- trunk/libnet-ssh2-perl/Makefile.PL (original)
+++ trunk/libnet-ssh2-perl/Makefile.PL Sat Apr 11 05:07:01 2009
@@ -16,7 +16,7 @@
 # try to find libSSH2 if we're not given a location
 unless($lib and $inc) {
     for my $prefix($Config{siteprefixexp},$Config{prefixexp},
-     '/usr','/usr/local','/opt') {
+     '/usr','/usr/local','/opt',$ENV{HOME}) {
         $lib ||= "$prefix/lib"
          if -f "$prefix/lib/libssh2$Config{_a}" or
             -f "$prefix/lib/libssh2.$Config{so}";

Modified: trunk/libnet-ssh2-perl/SSH2.xs
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libnet-ssh2-perl/SSH2.xs?rev=33030&op=diff
==============================================================================
--- trunk/libnet-ssh2-perl/SSH2.xs (original)
+++ trunk/libnet-ssh2-perl/SSH2.xs Sat Apr 11 05:07:01 2009
@@ -173,13 +173,15 @@
 
 /* libssh2 allocator thunks */
 LIBSSH2_ALLOC_FUNC(local_alloc) {
-    return Perl_malloc(count);
+    void *buf;
+    New(0, buf, count, char);
+    return buf;
 }
 LIBSSH2_REALLOC_FUNC(local_realloc) {
-    return Perl_realloc(ptr, count);
+    return Renew(ptr, count, char);
 }
 LIBSSH2_FREE_FUNC(local_free) {
-    Perl_mfree(ptr);
+    Safefree(ptr);
 }
 
 /* set Net:SSH2-specific error message */
@@ -349,8 +351,8 @@
 
     /* single prompt, no echo: assume it's a password request */
     pv_password = SvPV(ss->sv_tmp, len_password);
-    responses[0].text = Perl_malloc(len_password);
-    memcpy(responses[0].text, pv_password, len_password);
+    New(0, responses[0].text, len_password, char);
+    Copy(pv_password, responses[0].text, len_password, char);
     responses[0].length = len_password;
 }
 
@@ -383,8 +385,8 @@
     for (i = 0; i < count; ++i) {
         STRLEN len_response;
         const char* pv_response = SvPV(ST(i), len_response);
-        responses[i].text = Perl_malloc(len_response);
-        memcpy(responses[i].text, pv_response, len_response);
+        New(0, responses[i].text, len_response, char);
+        Copy(pv_response, responses[i].text, len_response, char);
         responses[i].length = len_response;
     }
 
@@ -409,8 +411,8 @@
     if (count > 0) {
         STRLEN len_password;
         const char* pv_password = SvPV(ST(0), len_password);
-        *newpw = Perl_malloc(len_password);
-        memcpy(*newpw, pv_password, len_password);
+        New(0, *newpw, len_password, char);
+        Copy(pv_password, *newpw, len_password, char);
         *newpw_len = len_password;
     }
 
@@ -759,7 +761,7 @@
         count = split_comma(sp, auth);
     else
         PUSHs(sv_2mortal(newSVpv(auth, 0)));
-    Perl_mfree(auth);
+    Safefree(auth);
     XSRETURN(count);
 
 void
@@ -786,7 +788,7 @@
     if (!password || !SvPOK(password)) {
         char* auth = libssh2_userauth_list(ss->session,
          pv_username, len_username);
-        Perl_mfree(auth);
+        Safefree(auth);
         XSRETURN_IV(!auth && libssh2_userauth_authenticated(ss->session));
     }
 
@@ -986,7 +988,10 @@
     debug("%s::poll: timeout = %d, array[%d]\n", class, timeout, count);
     if (!count)  // some architectures return null for malloc(0)
         XSRETURN_IV(0);
-    if (!(pollfd = Perl_malloc(sizeof(LIBSSH2_POLLFD) * count))) {
+
+    New(0, pollfd, count, LIBSSH2_POLLFD);
+
+    if (!pollfd) {
         set_error(ss, 0, "out of memory allocating pollfd structures");
         XSRETURN_EMPTY;
     }
@@ -1006,7 +1011,7 @@
                 debug("- [%d] = channel\n", i);
                 pollfd[i].type = LIBSSH2_POLLFD_CHANNEL;
                 pollfd[i].fd.channel =
-                 ((SSH2_CHANNEL*)SvIVX(SvRV(*handle)))->channel;
+                 ((SSH2_CHANNEL*)SvIVX(GvSV((GV*)SvRV(*handle))))->channel;
             } else if(strEQ(package, "Net::SSH2::Listener")) {
                 debug("- [%d] = listener\n", i);
                 pollfd[i].type = LIBSSH2_POLLFD_LISTENER;
@@ -1046,7 +1051,7 @@
         debug("- [%d] revents %d\n", i, pollfd[i].revents);
     }
 
-    Perl_mfree(pollfd);
+    Safefree(pollfd);
     if (changed < 0)
         XSRETURN_EMPTY;
     XSRETURN_IV(changed);
@@ -1707,7 +1712,8 @@
     pv_blob = SvPV(blob, len_blob);
 
     num_attrs = items - 4;
-    if (!(attrs = Perl_malloc(sizeof(*attrs) * num_attrs))) {
+    New(0, attrs, num_attrs, libssh2_publickey_attribute);
+    if (!attrs) {
         set_error(pk->ss, 0, "out of memory allocating attribute structures");
         XSRETURN_EMPTY;
     }
@@ -1740,7 +1746,7 @@
     success = !libssh2_publickey_add_ex(pk->pkey,
      pv_name, len_name, pv_blob, len_blob, overwrite, num_attrs, attrs);
 
-    Perl_mfree(attrs);
+    Safefree(attrs);
     XSRETURN_IV(!success);
     
 void

Added: trunk/libnet-ssh2-perl/debian/README.source
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libnet-ssh2-perl/debian/README.source?rev=33030&op=file
==============================================================================
--- trunk/libnet-ssh2-perl/debian/README.source (added)
+++ trunk/libnet-ssh2-perl/debian/README.source Sat Apr 11 05:07:01 2009
@@ -1,0 +1,5 @@
+This package uses quilt to manage all modifications to the upstream
+source.  Changes are stored in the source package as diffs in
+debian/patches and applied during the build.
+
+See /usr/share/doc/quilt/README.source for a detailed explanation.

Modified: trunk/libnet-ssh2-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libnet-ssh2-perl/debian/changelog?rev=33030&op=diff
==============================================================================
--- trunk/libnet-ssh2-perl/debian/changelog (original)
+++ trunk/libnet-ssh2-perl/debian/changelog Sat Apr 11 05:07:01 2009
@@ -1,3 +1,12 @@
+libnet-ssh2-perl (0.19-1) UNRELEASED; urgency=low
+
+  * New upstream release
+  * Debian Policy 3.8.1
+  * Add debian/README.source to document quilt usage, as required by
+    Debian Policy since 3.8.0.
+
+ -- Ryan Niebur <ryanryan52 at gmail.com>  Fri, 10 Apr 2009 22:06:52 -0700
+
 libnet-ssh2-perl (0.18-1) unstable; urgency=low
 
   * Initial Release. (Closes: #412199)

Modified: trunk/libnet-ssh2-perl/debian/control
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libnet-ssh2-perl/debian/control?rev=33030&op=diff
==============================================================================
--- trunk/libnet-ssh2-perl/debian/control (original)
+++ trunk/libnet-ssh2-perl/debian/control Sat Apr 11 05:07:01 2009
@@ -4,7 +4,7 @@
 Build-Depends: debhelper (>= 7), perl (>= 5.6.0-12), libssh2-1-dev, quilt
 Maintainer: Debian Perl Group <pkg-perl-maintainers at lists.alioth.debian.org>
 Uploaders: Ryan Niebur <ryanryan52 at gmail.com>
-Standards-Version: 3.8.0
+Standards-Version: 3.8.1
 Homepage: http://search.cpan.org/dist/Net-SSH2/
 Vcs-Svn: svn://svn.debian.org/pkg-perl/trunk/libnet-ssh2-perl/
 Vcs-Browser: http://svn.debian.org/viewsvn/pkg-perl/trunk/libnet-ssh2-perl/

Modified: trunk/libnet-ssh2-perl/lib/Net/SSH2.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libnet-ssh2-perl/lib/Net/SSH2.pm?rev=33030&op=diff
==============================================================================
--- trunk/libnet-ssh2-perl/lib/Net/SSH2.pm (original)
+++ trunk/libnet-ssh2-perl/lib/Net/SSH2.pm Sat Apr 11 05:07:01 2009
@@ -189,7 +189,7 @@
 
 our @EXPORT_OK = @{$EXPORT_TAGS{all}};
 
-our $VERSION = '0.18';
+our $VERSION = '0.19';
 
 
 # methods

Modified: trunk/libnet-ssh2-perl/t/Net-SSH2.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libnet-ssh2-perl/t/Net-SSH2.t?rev=33030&op=diff
==============================================================================
--- trunk/libnet-ssh2-perl/t/Net-SSH2.t (original)
+++ trunk/libnet-ssh2-perl/t/Net-SSH2.t Sat Apr 11 05:07:01 2009
@@ -31,8 +31,15 @@
 my ($version2, $vernum, $banner) = $ssh2->version();
 is($version, $version2, 'list version match');
 my $major = int($version);
-ok(($vernum >> 8) == ($major << 8) + ($version - $major) * 100,
- 'decimal version matches');
+
+if ($major > 0) {
+  ok(($vernum >> 8) == ($major << 8) + ($version - $major) * 10,
+   'decimal version matches');
+} else {
+  ok(($vernum >> 8) == ($major << 8) + ($version - $major) * 100,
+   'decimal version matches');
+}
+
 is($banner, "SSH-2.0-libssh2_$version", "banner is $banner");
 
 # (2) timeout
@@ -85,7 +92,9 @@
 
 # (2) authenticate
 @auth = $pass ? (password => $pass) : (interact => 1);
-my $type = $ssh2->auth(username => $user, @auth);
+my $type = $ssh2->auth(username => $user, @auth,
+  publickey  => "$ENV{HOME}/.ssh/id_dsa.pub",
+  privatekey => "$ENV{HOME}/.ssh/id_dsa");
 ok($type, "authenticated via: $type");
 SKIP: { # SKIP-auth
 skip '- failed to authenticate with server', 37 unless $ssh2->auth_ok;
@@ -178,7 +187,8 @@
 $fh = $sftp->open($altname);
 isa_ok($fh, 'Net::SSH2::File', 'opened file');
 scalar <$fh> for 1..2;
-chomp(my $line = <$fh>);
+my $line = <$fh>;
+chomp $line;
 is($line, '# THIS LINE WILL BE READ BY A TEST BELOW', "read '$line'");
 #undef $fh;  # don't undef it, ensure reference counts work properly
 
@@ -194,7 +204,8 @@
 my @poll = { handle => $chan, events => ['in'] };
 ok($ssh2->poll(250, \@poll), 'got poll response');
 ok($poll[0]->{revents}->{in}, 'got input event');
-chomp($line = <$chan>);
+$line = <$chan>;
+chomp $line;
 is($line, '/', "got result '/'");
 $line = <$chan>;
 ok(!$line, 'no more lines');

Modified: trunk/libnet-ssh2-perl/typemap
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libnet-ssh2-perl/typemap?rev=33030&op=diff
==============================================================================
--- trunk/libnet-ssh2-perl/typemap (original)
+++ trunk/libnet-ssh2-perl/typemap Sat Apr 11 05:07:01 2009
@@ -29,11 +29,15 @@
     const char* name = form("_GEN_%ld", (long)net_ch_gensym++);
     SvUPGRADE((SV*)gv, SVt_PVGV);
     SvUPGRADE((SV*)io, SVt_PVIO);
-    SvIVX(gv) = PTR2IV($var);
     gv_init(gv, gv_stashpv("Net::SSH2::Channel", 0/*create*/),
      name, strlen(name), 0/*multi*/);
+    GvSV(gv) = newSViv(PTR2IV($var));
     GvIOp(gv) = io;
-    sv_magic((SV*)io, newRV((SV*)gv), PERL_MAGIC_tiedscalar, Nullch, 0);
+    if (PERL_VERSION > 6) {
+      sv_magic((SV*)io, newRV((SV*)gv), PERL_MAGIC_tiedscalar, Nullch, 0);
+    } else {
+      sv_magic((SV*)gv, newRV((SV*)gv), PERL_MAGIC_tiedscalar, Nullch, 0);
+    }
     }
 
 O_LISTENER
@@ -49,11 +53,15 @@
     const char* name = form("_GEN_%ld", (long)net_fi_gensym++);
     SvUPGRADE((SV*)gv, SVt_PVGV);
     SvUPGRADE((SV*)io, SVt_PVIO);
-    SvIVX(gv) = PTR2IV($var);
     gv_init(gv, gv_stashpv("Net::SSH2::File", 0/*create*/),
      name, strlen(name), 0/*multi*/);
+    GvSV(gv) = newSViv(PTR2IV($var));
     GvIOp(gv) = io;
-    sv_magic((SV*)io, newRV((SV*)gv), PERL_MAGIC_tiedscalar, Nullch, 0);
+    if (PERL_VERSION > 6) {
+      sv_magic((SV*)io, newRV((SV*)gv), PERL_MAGIC_tiedscalar, Nullch, 0);
+    } else {
+      sv_magic((SV*)gv, newRV((SV*)gv), PERL_MAGIC_tiedscalar, Nullch, 0);
+    }
     }
 
 O_DIR
@@ -80,7 +88,7 @@
 
 O_CHANNEL
     if(sv_isobject($arg) && (SvTYPE(SvRV($arg)) == SVt_PVGV))
-        $var = ($type)SvIVX((SV*)SvRV($arg));
+        $var = ($type)SvIVX(GvSV((GV*)SvRV($arg)));
     else
         croak(\"${Package}::$func_name() - invalid channel object\");
 
@@ -98,7 +106,7 @@
 
 O_FILE
     if(sv_isobject($arg) && (SvTYPE(SvRV($arg)) == SVt_PVGV))
-        $var = ($type)SvIVX((SV*)SvRV($arg));
+        $var = ($type)SvIVX(GvSV((GV*)SvRV($arg)));
     else
         croak(\"${Package}::$func_name() - invalid SFTP file object\");
 




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