r66178 - in /trunk/libdata-peek-perl: ChangeLog MANIFEST META.yml Makefile.PL Peek.pm README debian/changelog debian/control debian/copyright debian/source/ debian/source/format t/22_DHexDump.t t/52_DGrow.t
jawnsy-guest at users.alioth.debian.org
jawnsy-guest at users.alioth.debian.org
Fri Dec 24 05:55:08 UTC 2010
Author: jawnsy-guest
Date: Fri Dec 24 05:55:00 2010
New Revision: 66178
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=66178
Log:
+ Adds DHexDump function
* Standards-Version 3.9.1 (no changes)
* Use new 3.0 (quilt) source format
Added:
trunk/libdata-peek-perl/debian/source/
trunk/libdata-peek-perl/debian/source/format
trunk/libdata-peek-perl/t/22_DHexDump.t
- copied unchanged from r66176, branches/upstream/libdata-peek-perl/current/t/22_DHexDump.t
Modified:
trunk/libdata-peek-perl/ChangeLog
trunk/libdata-peek-perl/MANIFEST
trunk/libdata-peek-perl/META.yml
trunk/libdata-peek-perl/Makefile.PL
trunk/libdata-peek-perl/Peek.pm
trunk/libdata-peek-perl/README
trunk/libdata-peek-perl/debian/changelog
trunk/libdata-peek-perl/debian/control
trunk/libdata-peek-perl/debian/copyright
trunk/libdata-peek-perl/t/52_DGrow.t
Modified: trunk/libdata-peek-perl/ChangeLog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdata-peek-perl/ChangeLog?rev=66178&op=diff
==============================================================================
--- trunk/libdata-peek-perl/ChangeLog (original)
+++ trunk/libdata-peek-perl/ChangeLog Fri Dec 24 05:55:00 2010
@@ -1,3 +1,10 @@
+2010-11-21 0.32 - H.Merijn Brand <h.m.brand at xs4all.nl>
+
+ * Require perl 5.8.0
+ * DGrow tests for bigger gap
+ * Spell checking
+ * Add DHexDump ()
+
2010-03-16 0.31 - H.Merijn Brand <h.m.brand at xs4all.nl>
* Dropped YAML spec to 1.0
Modified: trunk/libdata-peek-perl/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdata-peek-perl/MANIFEST?rev=66178&op=diff
==============================================================================
--- trunk/libdata-peek-perl/MANIFEST (original)
+++ trunk/libdata-peek-perl/MANIFEST Fri Dec 24 05:55:00 2010
@@ -11,6 +11,7 @@
t/10_DDumper.t Tests for DDumper ()
t/20_DPeek.t Tests for DPeek ()
t/21_DDisplay.t Tests for DDisplay ()
+t/22_DHexDump.t Tests for DHexDump ()
t/30_DDump-s.t Tests for DDump () returning string using _XS
t/31_DDump-s.t Tests for DDump () returning string using _IO
t/40_DDump-h.t Tests for DDump () returning hash using _XS
Modified: trunk/libdata-peek-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdata-peek-perl/META.yml?rev=66178&op=diff
==============================================================================
--- trunk/libdata-peek-perl/META.yml (original)
+++ trunk/libdata-peek-perl/META.yml Fri Dec 24 05:55:00 2010
@@ -1,6 +1,6 @@
--- #YAML:1.0
name: Data::Peek
-version: 0.31
+version: 0.32
abstract: Modified and extended debugging facilities
license: perl
author:
@@ -10,16 +10,16 @@
provides:
Data::Peek:
file: Peek.pm
- version: 0.31
+ version: 0.32
requires:
- perl: 5.006
+ perl: 5.008
DynaLoader: 0
recommends:
- perl: 5.010001
+ perl: 5.012002
configure_requires:
ExtUtils::MakeMaker: 0
build_requires:
- perl: 5.006
+ perl: 5.008
Data::Dumper: 0
Test::Harness: 0
Test::More: 0
Modified: trunk/libdata-peek-perl/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdata-peek-perl/Makefile.PL?rev=66178&op=diff
==============================================================================
--- trunk/libdata-peek-perl/Makefile.PL (original)
+++ trunk/libdata-peek-perl/Makefile.PL Fri Dec 24 05:55:00 2010
@@ -2,7 +2,7 @@
# Copyright PROCURA B.V. (c) 2008-2010 H.Merijn Brand
-require 5.006; # <- also see postamble at the bottom for META.yml
+require 5.008; # <- also see postamble at the bottom for META.yml
use strict;
use ExtUtils::MakeMaker;
@@ -91,7 +91,10 @@
'leaktest:',
q{ sandbox/leaktest $(FULLPERLRUN) "test_harness($(TEST_VERBOSE), '$(INST_LIB)', '$(INST_ARCHLIB)')" $(TEST_FILES)},
'',
- 'checkmeta:',
+ 'spellcheck:',
+ ' pod-spell-check --aspell',
+ '',
+ 'checkmeta: spellcheck',
' perl sandbox/genMETA.pl -c',
'',
'fixmeta: distmeta',
Modified: trunk/libdata-peek-perl/Peek.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdata-peek-perl/Peek.pm?rev=66178&op=diff
==============================================================================
--- trunk/libdata-peek-perl/Peek.pm (original)
+++ trunk/libdata-peek-perl/Peek.pm Fri Dec 24 05:55:00 2010
@@ -6,11 +6,11 @@
use DynaLoader ();
use vars qw( $VERSION @ISA @EXPORT @EXPORT_OK );
-$VERSION = "0.31";
+$VERSION = "0.32";
@ISA = qw( DynaLoader Exporter );
- at EXPORT = qw( DDumper DDsort DPeek DDisplay DDump DDual DGrow );
+ at EXPORT = qw( DDumper DDsort DPeek DDisplay DDump DHexDump DDual DGrow );
@EXPORT_OK = qw( triplevar );
-$] >= 5.007003 and push @EXPORT, "DDump_IO";
+push @EXPORT, "DDump_IO";
bootstrap Data::Peek $VERSION;
@@ -166,6 +166,33 @@
warn $dump;
} # DDump
+sub DHexDump
+{
+ use bytes;
+ my $off = 0;
+ my @out;
+ my $var = @_ ? $_[0] : $_;
+ defined $var or return;
+ my $str = "$var"; # force stringification
+ for (unpack "(A32)*", unpack "H*", $str) {
+ my @b = unpack "(A2)*", $_;
+ my $out = sprintf "%04x ", $off;
+ $out .= " ".($b[$_]||" ") for 0 .. 7;
+ $out .= " ";
+ $out .= " ".($b[$_]||" ") for 8 .. 15;
+ $out .= " ";
+ $out .= ($_ < 0x20 || $_ >= 0x7f ? "." : chr $_) for map { hex $_ } @b;
+ push @out, $out."\n";
+ $off += 16;
+ }
+
+ wantarray and return @out;
+
+ defined wantarray and return join "", @out;
+
+ warn join "", @out;
+ } # DHexDump
+
"Indent";
__END__
@@ -184,6 +211,7 @@
my ($pv, $iv, $nv, $rv, $magic) = DDual ($var [, 1]);
print DPeek for DDual ($!, 1);
print DDisplay ("ab\nc\x{20ac}\rdef\n");
+ print DHexDump ("ab\nc\x{20ac}\rdef\n");
my $dump = DDump $var;
my %hash = DDump \@list;
@@ -298,6 +326,24 @@
"abc\nde\x{20ac}fg"
+=head2 DHexDump
+
+=head2 DHexDump ($var)
+
+Show the (stringified) content of a scalar as a hex-dump. If C<$var>
+is omitted, C<$_> is dumped. Returns C<undef> or an empty list if
+C<$var> (or C<$_>) is undefined.
+
+In void context, the dump is done to STDERR. In scalar context, the
+complete dump is returned as a single string. In list context, the dump
+is returned as lines.
+
+Example
+
+ print DHexDump "abc\x{0a}de\x{20ac}fg";
+
+ 0000 61 62 63 0a 64 65 e2 82 ac 66 67 abc.de...fg
+
=head2 my ($pv, $iv, $nv, $rv, $hm) = DDual ($var [, $getmagic])
DDual will return the basic elements in a variable, guaranteeing that no
@@ -367,7 +413,7 @@
A very useful module when debugging is C<Devel::Peek>, but is has one big
disadvantage: it only prints to STDERR, which is not very handy when your
-code wants to inspect variables al a low level.
+code wants to inspect variables at a low level.
Perl itself has C<sv_dump ()>, which does something similar, but still
prints to STDERR, and only one level deep.
@@ -470,8 +516,7 @@
=head2 DDump_IO ($io, $var [, $dig_level])
A wrapper function around perl's internal C<Perl_do_sv_dump ()>, which
-makes C<Devel::Peek> completely superfluous. As PerlIO is only available
-perl version 5.7.3 and up, this function is not available in older perls.
+makes C<Devel::Peek> completely superfluous.
Example
@@ -561,8 +606,8 @@
=head1 SEE ALSO
-L<Devel::Peek(3)>, L<Data::Dumper(3)>, L<Data::Dump(3)>, L<Devel::Dumpvar>,
-L<Data::Dump::Streamer(3)>
+L<Devel::Peek>, L<Data::Dumper>, L<Data::Dump>, L<Devel::Dumpvar>,
+L<Data::Dump::Streamer>
=head1 AUTHOR
Modified: trunk/libdata-peek-perl/README
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdata-peek-perl/README?rev=66178&op=diff
==============================================================================
--- trunk/libdata-peek-perl/README (original)
+++ trunk/libdata-peek-perl/README Fri Dec 24 05:55:00 2010
@@ -18,12 +18,11 @@
DPeek () is a wrapper around internals Perl_sv_peek
DDump_IO () is a wrapper around perl's core function do_sv_dump (),
-which acts like sv_dump (), but to a PerlIO stream, which is only
-available in perl 5.8 and higher.
+which acts like sv_dump (), but to a PerlIO stream.
=head1 PREREQUISITES
-Perl 5.6.0 and up.
+Perl 5.8.0 and up.
Some versions of perl on some operating system(s) might not have
exported the internals (yet). This module won't build then.
Modified: trunk/libdata-peek-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdata-peek-perl/debian/changelog?rev=66178&op=diff
==============================================================================
--- trunk/libdata-peek-perl/debian/changelog (original)
+++ trunk/libdata-peek-perl/debian/changelog Fri Dec 24 05:55:00 2010
@@ -1,11 +1,11 @@
-libdata-peek-perl (0.31-1) UNRELEASED; urgency=low
-
- Changes META.yml to 1.0 instead of 1.1 spec
- IGNORE-VERSION: 0.31-1
+libdata-peek-perl (0.32-1) UNRELEASED; urgency=low
* New upstream release
+ + Adds DHexDump function
+ * Standards-Version 3.9.1 (no changes)
+ * Use new 3.0 (quilt) source format
- -- Jonathan Yu <jawnsy at cpan.org> Wed, 17 Mar 2010 16:26:16 -0400
+ -- Jonathan Yu <jawnsy at cpan.org> Fri, 24 Dec 2010 01:11:23 -0500
libdata-peek-perl (0.30-1) unstable; urgency=low
Modified: trunk/libdata-peek-perl/debian/control
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdata-peek-perl/debian/control?rev=66178&op=diff
==============================================================================
--- trunk/libdata-peek-perl/debian/control (original)
+++ trunk/libdata-peek-perl/debian/control Fri Dec 24 05:55:00 2010
@@ -6,7 +6,7 @@
Maintainer: Debian Perl Group <pkg-perl-maintainers at lists.alioth.debian.org>
Uploaders: Jeremiah C. Foster <jeremiah at jeremiahfoster.com>,
Jonathan Yu <jawnsy at cpan.org>
-Standards-Version: 3.8.4
+Standards-Version: 3.9.1
Homepage: http://search.cpan.org/dist/Data-Peek/
Vcs-Svn: svn://svn.debian.org/pkg-perl/trunk/libdata-peek-perl/
Vcs-Browser: http://svn.debian.org/viewsvn/pkg-perl/trunk/libdata-peek-perl/
Modified: trunk/libdata-peek-perl/debian/copyright
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdata-peek-perl/debian/copyright?rev=66178&op=diff
==============================================================================
--- trunk/libdata-peek-perl/debian/copyright (original)
+++ trunk/libdata-peek-perl/debian/copyright Fri Dec 24 05:55:00 2010
@@ -22,8 +22,8 @@
This program is free software; you can redistribute it and/or modify
it under the terms of the Artistic License, which comes with Perl.
.
- On Debian GNU/Linux systems, the complete text of the Artistic License
- can be found in `/usr/share/common-licenses/Artistic'
+ On Debian systems, the complete text of the Artistic License can be
+ found in `/usr/share/common-licenses/Artistic'
License: GPL-1+
This program is free software; you can redistribute it and/or modify
@@ -31,5 +31,5 @@
the Free Software Foundation; either version 1, or (at your option)
any later version.
.
- On Debian GNU/Linux systems, the complete text of the GNU General
- Public License can be found in `/usr/share/common-licenses/GPL'
+ On Debian systems, the complete text of the GNU General Public
+ License can be found in `/usr/share/common-licenses/GPL'
Added: trunk/libdata-peek-perl/debian/source/format
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdata-peek-perl/debian/source/format?rev=66178&op=file
==============================================================================
--- trunk/libdata-peek-perl/debian/source/format (added)
+++ trunk/libdata-peek-perl/debian/source/format Fri Dec 24 05:55:00 2010
@@ -1,0 +1,1 @@
+3.0 (quilt)
Modified: trunk/libdata-peek-perl/t/52_DGrow.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdata-peek-perl/t/52_DGrow.t?rev=66178&op=diff
==============================================================================
--- trunk/libdata-peek-perl/t/52_DGrow.t (original)
+++ trunk/libdata-peek-perl/t/52_DGrow.t Fri Dec 24 05:55:00 2010
@@ -12,19 +12,22 @@
is (length ($x), 0, "Initial length = 0");
my %dd = DDump $x;
ok ($dd{LEN} <= 16);
-ok (my $l = DGrow ($x, 10000), "Set to 10000");
+my $len = 10240;
+ok (my $l = DGrow ($x, $len), "Set to $len");
is (length ($x), 0, "Variable content");
-ok ($l >= 10000, "returned LEN >= 10000");
-ok ($l <= 10240, "returned LEN <= 10240");
+ok ($l >= $len, "returned LEN >= $len");
+my $limit = 4 * $len;
+ok ($l <= $limit, "returned LEN <= $limit");
%dd = DDump $x;
-ok ($dd{LEN} >= 10000, "LEN in variable >= 10000");
-ok ($dd{LEN} <= 10240, "LEN in variable <= 10240");
-ok ($l = DGrow (\$x, 20000), "Set to 20000");
-ok ($l >= 20000, "LEN in variable >= 20000");
-ok ($l <= 20480, "LEN in variable <= 20480");
+ok ($dd{LEN} >= $len, "LEN in variable >= $len");
+ok ($dd{LEN} <= $limit, "LEN in variable <= limit");
+ok ($l = DGrow (\$x, $limit), "Set to $limit");
+ok ($l >= $limit, "LEN in variable >= $limit");
+($len, $limit) = ($limit, 4 * $limit);
+ok ($l <= $limit, "LEN in variable <= $limit");
%dd = DDump $x;
-ok ($dd{LEN} >= 20000, "LEN in variable >= 20000");
-ok ($dd{LEN} <= 20480, "LEN in variable <= 20480");
+ok ($dd{LEN} >= $len, "LEN in variable >= $len");
+ok ($dd{LEN} <= $limit, "LEN in variable <= $limit");
is (DGrow ($x, 20), $l, "Don't shrink");
1;
More information about the Pkg-perl-cvs-commits
mailing list