In perl.git, the branch blead has been updated <http://perl5.git.perl.org/perl.git/commitdiff/ab2a3ce27dfc911941e11f1e1905dfd528cb562b?hp=eb578fdb5569b91c28466a4d1939e381ff6ceaf4>
- Log ----------------------------------------------------------------- commit ab2a3ce27dfc911941e11f1e1905dfd528cb562b Author: Steve Hay <[email protected]> Date: Sun Aug 19 12:27:06 2012 +0100 Corrections to Maintainers.pl and perldelta.pod for Text-Tabs+Wrap M Porting/Maintainers.pl M pod/perldelta.pod commit e7b92d54220380e79a3e6d6717958415a905ee7e Author: Steve Hay <[email protected]> Date: Sun Aug 19 11:51:52 2012 +0100 Upgrade to Text-Tabs+Wrap-2012.0818 This incorporates earlier blead customizations to t/fill.t and t/tabs.t M MANIFEST M Porting/Maintainers.pl M cpan/Text-Tabs/CHANGELOG M cpan/Text-Tabs/lib/Text/Tabs.pm M cpan/Text-Tabs/lib/Text/Wrap.pm M cpan/Text-Tabs/t/Jacobson.t M cpan/Text-Tabs/t/Jacobson2.t A cpan/Text-Tabs/t/Tabs-ElCid.t A cpan/Text-Tabs/t/Wrap-JLB.t M pod/perldelta.pod commit 61bfcae1742705b6c456ff1777236282ff285652 Author: Steve Hay <[email protected]> Date: Sun Aug 19 11:31:51 2012 +0100 Upgrade Module-Metadata to 1.000011 M MANIFEST M Porting/Maintainers.pl M cpan/Module-Metadata/lib/Module/Metadata.pm A cpan/Module-Metadata/t/encoding.t A cpan/Module-Metadata/t/lib/BOMTest/UTF16BE.pm A cpan/Module-Metadata/t/lib/BOMTest/UTF16LE.pm A cpan/Module-Metadata/t/lib/BOMTest/UTF8.pm M cpan/Module-Metadata/t/metadata.t M pod/perldelta.pod commit 64b0d2b9435a25fdd224a130da19e9d42b08d9f2 Author: Steve Hay <[email protected]> Date: Sun Aug 19 11:24:53 2012 +0100 Upgrade Module-Build to 0.4003 M Porting/Maintainers.pl M cpan/Module-Build/Changes M cpan/Module-Build/lib/Module/Build.pm M cpan/Module-Build/lib/Module/Build/Base.pm M cpan/Module-Build/lib/Module/Build/Compat.pm M cpan/Module-Build/lib/Module/Build/Config.pm M cpan/Module-Build/lib/Module/Build/Cookbook.pm M cpan/Module-Build/lib/Module/Build/Dumper.pm M cpan/Module-Build/lib/Module/Build/ModuleInfo.pm M cpan/Module-Build/lib/Module/Build/Notes.pm M cpan/Module-Build/lib/Module/Build/PPMMaker.pm M cpan/Module-Build/lib/Module/Build/Platform/Amiga.pm M cpan/Module-Build/lib/Module/Build/Platform/Default.pm M cpan/Module-Build/lib/Module/Build/Platform/EBCDIC.pm M cpan/Module-Build/lib/Module/Build/Platform/MPEiX.pm M cpan/Module-Build/lib/Module/Build/Platform/MacOS.pm M cpan/Module-Build/lib/Module/Build/Platform/RiscOS.pm M cpan/Module-Build/lib/Module/Build/Platform/Unix.pm M cpan/Module-Build/lib/Module/Build/Platform/VMS.pm M cpan/Module-Build/lib/Module/Build/Platform/VOS.pm M cpan/Module-Build/lib/Module/Build/Platform/Windows.pm M cpan/Module-Build/lib/Module/Build/Platform/aix.pm M cpan/Module-Build/lib/Module/Build/Platform/cygwin.pm M cpan/Module-Build/lib/Module/Build/Platform/darwin.pm M cpan/Module-Build/lib/Module/Build/Platform/os2.pm M cpan/Module-Build/lib/Module/Build/PodParser.pm M cpan/Module-Build/lib/inc/latest.pm M cpan/Module-Build/lib/inc/latest/private.pm M cpan/Module-Build/t/metadata.t M pod/perldelta.pod ----------------------------------------------------------------------- Summary of changes: MANIFEST | 6 + Porting/Maintainers.pl | 21 ++- cpan/Module-Build/Changes | 10 +- cpan/Module-Build/lib/Module/Build.pm | 2 +- cpan/Module-Build/lib/Module/Build/Base.pm | 2 +- cpan/Module-Build/lib/Module/Build/Compat.pm | 2 +- cpan/Module-Build/lib/Module/Build/Config.pm | 2 +- cpan/Module-Build/lib/Module/Build/Cookbook.pm | 2 +- cpan/Module-Build/lib/Module/Build/Dumper.pm | 2 +- cpan/Module-Build/lib/Module/Build/ModuleInfo.pm | 2 +- cpan/Module-Build/lib/Module/Build/Notes.pm | 2 +- cpan/Module-Build/lib/Module/Build/PPMMaker.pm | 2 +- .../lib/Module/Build/Platform/Amiga.pm | 2 +- .../lib/Module/Build/Platform/Default.pm | 2 +- .../lib/Module/Build/Platform/EBCDIC.pm | 2 +- .../lib/Module/Build/Platform/MPEiX.pm | 2 +- .../lib/Module/Build/Platform/MacOS.pm | 2 +- .../lib/Module/Build/Platform/RiscOS.pm | 2 +- .../Module-Build/lib/Module/Build/Platform/Unix.pm | 2 +- cpan/Module-Build/lib/Module/Build/Platform/VMS.pm | 2 +- cpan/Module-Build/lib/Module/Build/Platform/VOS.pm | 2 +- .../lib/Module/Build/Platform/Windows.pm | 2 +- cpan/Module-Build/lib/Module/Build/Platform/aix.pm | 2 +- .../lib/Module/Build/Platform/cygwin.pm | 2 +- .../lib/Module/Build/Platform/darwin.pm | 2 +- cpan/Module-Build/lib/Module/Build/Platform/os2.pm | 2 +- cpan/Module-Build/lib/Module/Build/PodParser.pm | 2 +- cpan/Module-Build/lib/inc/latest.pm | 2 +- cpan/Module-Build/lib/inc/latest/private.pm | 2 +- cpan/Module-Build/t/metadata.t | 4 +- cpan/Module-Metadata/lib/Module/Metadata.pm | 139 +++++++++++----- cpan/Module-Metadata/t/encoding.t | 30 ++++ cpan/Module-Metadata/t/lib/BOMTest/UTF16BE.pm | Bin 0 -> 238 bytes cpan/Module-Metadata/t/lib/BOMTest/UTF16LE.pm | Bin 0 -> 238 bytes cpan/Module-Metadata/t/lib/BOMTest/UTF8.pm | 13 ++ cpan/Module-Metadata/t/metadata.t | 70 +++++++- cpan/Text-Tabs/CHANGELOG | 18 ++ cpan/Text-Tabs/lib/Text/Tabs.pm | 82 ++++++++-- cpan/Text-Tabs/lib/Text/Wrap.pm | 76 ++++++--- cpan/Text-Tabs/t/Jacobson.t | 2 +- cpan/Text-Tabs/t/Jacobson2.t | 2 +- cpan/Text-Tabs/t/Tabs-ElCid.t | 176 ++++++++++++++++++++ cpan/Text-Tabs/t/Wrap-JLB.t | 151 +++++++++++++++++ pod/perldelta.pod | 13 +- 44 files changed, 737 insertions(+), 128 deletions(-) create mode 100644 cpan/Module-Metadata/t/encoding.t create mode 100644 cpan/Module-Metadata/t/lib/BOMTest/UTF16BE.pm create mode 100644 cpan/Module-Metadata/t/lib/BOMTest/UTF16LE.pm create mode 100644 cpan/Module-Metadata/t/lib/BOMTest/UTF8.pm create mode 100644 cpan/Text-Tabs/t/Tabs-ElCid.t create mode 100644 cpan/Text-Tabs/t/Wrap-JLB.t diff --git a/MANIFEST b/MANIFEST index 25f2546..cd8023b 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1772,8 +1772,12 @@ cpan/Module-Load/t/to_load/Must/Be/Loaded.pm Module::Load tests cpan/Module-Load/t/to_load/TestModule.pm Module::Load tests cpan/Module-Load/t/to_load/ToBeLoaded Module::Load tests cpan/Module-Metadata/lib/Module/Metadata.pm +cpan/Module-Metadata/t/encoding.t cpan/Module-Metadata/t/lib/0_1/Foo.pm cpan/Module-Metadata/t/lib/0_2/Foo.pm +cpan/Module-Metadata/t/lib/BOMTest/UTF16BE.pm +cpan/Module-Metadata/t/lib/BOMTest/UTF16LE.pm +cpan/Module-Metadata/t/lib/BOMTest/UTF8.pm cpan/Module-Metadata/t/lib/DistGen.pm cpan/Module-Metadata/t/lib/MBTest.pm cpan/Module-Metadata/t/lib/Tie/CPHash.pm @@ -2648,7 +2652,9 @@ cpan/Text-Tabs/t/Jacobson.t See if Text::Tabs is working cpan/Text-Tabs/t/Jochen.t See if Text::Tabs is working cpan/Text-Tabs/t/sep2.t See if Text::Tabs is working cpan/Text-Tabs/t/sep.t See if Text::Tabs is working +cpan/Text-Tabs/t/Tabs-ElCid.t See if Text::Tabs works cpan/Text-Tabs/t/tabs.t See if Text::Tabs works +cpan/Text-Tabs/t/Wrap-JLB.t See if Text::Wrap::wrap works cpan/Text-Tabs/t/wrap_separator2.t See if Text::Wrap::wrap works cpan/Text-Tabs/t/wrap.t See if Text::Wrap::wrap works cpan/Tie-RefHash/lib/Tie/RefHash.pm Base class for tied hashes with references as keys diff --git a/Porting/Maintainers.pl b/Porting/Maintainers.pl index 180f560..5b23e82 100755 --- a/Porting/Maintainers.pl +++ b/Porting/Maintainers.pl @@ -1246,7 +1246,7 @@ use File::Glob qw(:case); 'Module::Build' => { 'MAINTAINER' => 'kwilliams', - 'DISTRIBUTION' => 'LEONT/Module-Build-0.4002.tar.gz', + 'DISTRIBUTION' => 'LEONT/Module-Build-0.4003.tar.gz', 'FILES' => q[cpan/Module-Build], 'EXCLUDED' => [ qw( t/par.t @@ -1289,7 +1289,7 @@ use File::Glob qw(:case); 'Module::Metadata' => { 'MAINTAINER' => 'dagolden', - 'DISTRIBUTION' => 'VPIT/Module-Metadata-1.000010.tar.gz', + 'DISTRIBUTION' => 'APEIRON/Module-Metadata-1.000011.tar.gz', 'FILES' => q[cpan/Module-Metadata], 'EXCLUDED' => [ qr{^maint}, @@ -1879,15 +1879,18 @@ use File::Glob qw(:case); 'Text-Tabs+Wrap' => { 'MAINTAINER' => 'muir', - 'DISTRIBUTION' => 'MUIR/modules/Text-Tabs+Wrap-2009.0305.tar.gz', + 'DISTRIBUTION' => 'MUIR/modules/Text-Tabs+Wrap-2012.0818.tar.gz', 'FILES' => q[cpan/Text-Tabs], - 'EXCLUDED' => ['t/dnsparks.t'], # see af6492bf9e - 'UPSTREAM' => 'cpan', - 'CUSTOMIZED' => [ - qw( t/fill.t - t/tabs.t - ), + 'EXCLUDED' => [ + qr/^lib\.old/, + 't/dnsparks.t', # see af6492bf9e ], + 'MAP' => { + '' => 'cpan/Text-Tabs/', + 'lib.modern/Text/Tabs.pm' => 'cpan/Text-Tabs/lib/Text/Tabs.pm', + 'lib.modern/Text/Wrap.pm' => 'cpan/Text-Tabs/lib/Text/Wrap.pm', + }, + 'UPSTREAM' => 'cpan', }, 'Thread::Queue' => { diff --git a/cpan/Module-Build/Changes b/cpan/Module-Build/Changes index 67f5e5a..5d79968 100644 --- a/cpan/Module-Build/Changes +++ b/cpan/Module-Build/Changes @@ -1,12 +1,18 @@ Revision history for Perl extension Module::Build. +0.4003 - Sat Aug 18 11:17:49 CEST 2012 + + [BUG FIXES] + + - Get rid of outdated metadata tests [Steve Hay] + 0.4002 - Fri Jul 27 20:04:09 EEST 2012 [BUG FIXES] - - Test for TAP::Harness version properly + - Test for TAP::Harness version properly [Leon Timmermans] - - Install to 'site' on 5.12+ + - Install to 'site' on 5.12+ [Leon Timmermans] [DOCUMENTATION] diff --git a/cpan/Module-Build/lib/Module/Build.pm b/cpan/Module-Build/lib/Module/Build.pm index a0760f1..fd835fc 100644 --- a/cpan/Module-Build/lib/Module/Build.pm +++ b/cpan/Module-Build/lib/Module/Build.pm @@ -16,7 +16,7 @@ use Module::Build::Base; use vars qw($VERSION @ISA); @ISA = qw(Module::Build::Base); -$VERSION = '0.4002'; +$VERSION = '0.4003'; $VERSION = eval $VERSION; diff --git a/cpan/Module-Build/lib/Module/Build/Base.pm b/cpan/Module-Build/lib/Module/Build/Base.pm index 4689447..cf42cc0 100644 --- a/cpan/Module-Build/lib/Module/Build/Base.pm +++ b/cpan/Module-Build/lib/Module/Build/Base.pm @@ -6,7 +6,7 @@ use strict; use vars qw($VERSION); use warnings; -$VERSION = '0.4002'; +$VERSION = '0.4003'; $VERSION = eval $VERSION; BEGIN { require 5.006001 } diff --git a/cpan/Module-Build/lib/Module/Build/Compat.pm b/cpan/Module-Build/lib/Module/Build/Compat.pm index 08f0c3b..79499a6 100644 --- a/cpan/Module-Build/lib/Module/Build/Compat.pm +++ b/cpan/Module-Build/lib/Module/Build/Compat.pm @@ -2,7 +2,7 @@ package Module::Build::Compat; use strict; use vars qw($VERSION); -$VERSION = '0.4002'; +$VERSION = '0.4003'; use File::Basename (); use File::Spec; diff --git a/cpan/Module-Build/lib/Module/Build/Config.pm b/cpan/Module-Build/lib/Module/Build/Config.pm index 58cd64a..88a3ff3 100644 --- a/cpan/Module-Build/lib/Module/Build/Config.pm +++ b/cpan/Module-Build/lib/Module/Build/Config.pm @@ -2,7 +2,7 @@ package Module::Build::Config; use strict; use vars qw($VERSION); -$VERSION = '0.4002'; +$VERSION = '0.4003'; $VERSION = eval $VERSION; use Config; diff --git a/cpan/Module-Build/lib/Module/Build/Cookbook.pm b/cpan/Module-Build/lib/Module/Build/Cookbook.pm index 2605118..e66020c 100644 --- a/cpan/Module-Build/lib/Module/Build/Cookbook.pm +++ b/cpan/Module-Build/lib/Module/Build/Cookbook.pm @@ -1,7 +1,7 @@ package Module::Build::Cookbook; use strict; use vars qw($VERSION); -$VERSION = '0.4002'; +$VERSION = '0.4003'; =head1 NAME diff --git a/cpan/Module-Build/lib/Module/Build/Dumper.pm b/cpan/Module-Build/lib/Module/Build/Dumper.pm index df451a9..73839c7 100644 --- a/cpan/Module-Build/lib/Module/Build/Dumper.pm +++ b/cpan/Module-Build/lib/Module/Build/Dumper.pm @@ -1,7 +1,7 @@ package Module::Build::Dumper; use strict; use vars qw($VERSION); -$VERSION = '0.4002'; +$VERSION = '0.4003'; # This is just a split-out of a wrapper function to do Data::Dumper # stuff "the right way". See: diff --git a/cpan/Module-Build/lib/Module/Build/ModuleInfo.pm b/cpan/Module-Build/lib/Module/Build/ModuleInfo.pm index 1e4a82b..b36cc38 100644 --- a/cpan/Module-Build/lib/Module/Build/ModuleInfo.pm +++ b/cpan/Module-Build/lib/Module/Build/ModuleInfo.pm @@ -4,7 +4,7 @@ package Module::Build::ModuleInfo; use strict; use vars qw($VERSION); -$VERSION = '0.4002'; +$VERSION = '0.4003'; $VERSION = eval $VERSION; require Module::Metadata; diff --git a/cpan/Module-Build/lib/Module/Build/Notes.pm b/cpan/Module-Build/lib/Module/Build/Notes.pm index 85de8cb..0477322 100644 --- a/cpan/Module-Build/lib/Module/Build/Notes.pm +++ b/cpan/Module-Build/lib/Module/Build/Notes.pm @@ -4,7 +4,7 @@ package Module::Build::Notes; use strict; use vars qw($VERSION); -$VERSION = '0.4002'; +$VERSION = '0.4003'; $VERSION = eval $VERSION; use Data::Dumper; use IO::File; diff --git a/cpan/Module-Build/lib/Module/Build/PPMMaker.pm b/cpan/Module-Build/lib/Module/Build/PPMMaker.pm index 1496b2b..34f5495 100644 --- a/cpan/Module-Build/lib/Module/Build/PPMMaker.pm +++ b/cpan/Module-Build/lib/Module/Build/PPMMaker.pm @@ -5,7 +5,7 @@ use Config; use vars qw($VERSION); use IO::File; -$VERSION = '0.4002'; +$VERSION = '0.4003'; $VERSION = eval $VERSION; # This code is mostly borrowed from ExtUtils::MM_Unix 6.10_03, with a diff --git a/cpan/Module-Build/lib/Module/Build/Platform/Amiga.pm b/cpan/Module-Build/lib/Module/Build/Platform/Amiga.pm index f2320bb..0be3dde 100644 --- a/cpan/Module-Build/lib/Module/Build/Platform/Amiga.pm +++ b/cpan/Module-Build/lib/Module/Build/Platform/Amiga.pm @@ -2,7 +2,7 @@ package Module::Build::Platform::Amiga; use strict; use vars qw($VERSION); -$VERSION = '0.4002'; +$VERSION = '0.4003'; $VERSION = eval $VERSION; use Module::Build::Base; diff --git a/cpan/Module-Build/lib/Module/Build/Platform/Default.pm b/cpan/Module-Build/lib/Module/Build/Platform/Default.pm index df888c5..53bffc0 100644 --- a/cpan/Module-Build/lib/Module/Build/Platform/Default.pm +++ b/cpan/Module-Build/lib/Module/Build/Platform/Default.pm @@ -2,7 +2,7 @@ package Module::Build::Platform::Default; use strict; use vars qw($VERSION); -$VERSION = '0.4002'; +$VERSION = '0.4003'; $VERSION = eval $VERSION; use Module::Build::Base; diff --git a/cpan/Module-Build/lib/Module/Build/Platform/EBCDIC.pm b/cpan/Module-Build/lib/Module/Build/Platform/EBCDIC.pm index c299ef5..8c4349b 100644 --- a/cpan/Module-Build/lib/Module/Build/Platform/EBCDIC.pm +++ b/cpan/Module-Build/lib/Module/Build/Platform/EBCDIC.pm @@ -2,7 +2,7 @@ package Module::Build::Platform::EBCDIC; use strict; use vars qw($VERSION); -$VERSION = '0.4002'; +$VERSION = '0.4003'; $VERSION = eval $VERSION; use Module::Build::Base; diff --git a/cpan/Module-Build/lib/Module/Build/Platform/MPEiX.pm b/cpan/Module-Build/lib/Module/Build/Platform/MPEiX.pm index c4d0396..5688a99 100644 --- a/cpan/Module-Build/lib/Module/Build/Platform/MPEiX.pm +++ b/cpan/Module-Build/lib/Module/Build/Platform/MPEiX.pm @@ -2,7 +2,7 @@ package Module::Build::Platform::MPEiX; use strict; use vars qw($VERSION); -$VERSION = '0.4002'; +$VERSION = '0.4003'; $VERSION = eval $VERSION; use Module::Build::Base; diff --git a/cpan/Module-Build/lib/Module/Build/Platform/MacOS.pm b/cpan/Module-Build/lib/Module/Build/Platform/MacOS.pm index 3d65a9b..8b56766 100644 --- a/cpan/Module-Build/lib/Module/Build/Platform/MacOS.pm +++ b/cpan/Module-Build/lib/Module/Build/Platform/MacOS.pm @@ -2,7 +2,7 @@ package Module::Build::Platform::MacOS; use strict; use vars qw($VERSION); -$VERSION = '0.4002'; +$VERSION = '0.4003'; $VERSION = eval $VERSION; use Module::Build::Base; use vars qw(@ISA); diff --git a/cpan/Module-Build/lib/Module/Build/Platform/RiscOS.pm b/cpan/Module-Build/lib/Module/Build/Platform/RiscOS.pm index 5c0bb3c..6ed9d3d 100644 --- a/cpan/Module-Build/lib/Module/Build/Platform/RiscOS.pm +++ b/cpan/Module-Build/lib/Module/Build/Platform/RiscOS.pm @@ -2,7 +2,7 @@ package Module::Build::Platform::RiscOS; use strict; use vars qw($VERSION); -$VERSION = '0.4002'; +$VERSION = '0.4003'; $VERSION = eval $VERSION; use Module::Build::Base; diff --git a/cpan/Module-Build/lib/Module/Build/Platform/Unix.pm b/cpan/Module-Build/lib/Module/Build/Platform/Unix.pm index 53c8c7c..e3d7ff5 100644 --- a/cpan/Module-Build/lib/Module/Build/Platform/Unix.pm +++ b/cpan/Module-Build/lib/Module/Build/Platform/Unix.pm @@ -2,7 +2,7 @@ package Module::Build::Platform::Unix; use strict; use vars qw($VERSION); -$VERSION = '0.4002'; +$VERSION = '0.4003'; $VERSION = eval $VERSION; use Module::Build::Base; diff --git a/cpan/Module-Build/lib/Module/Build/Platform/VMS.pm b/cpan/Module-Build/lib/Module/Build/Platform/VMS.pm index b5344f5..7ff7e05 100644 --- a/cpan/Module-Build/lib/Module/Build/Platform/VMS.pm +++ b/cpan/Module-Build/lib/Module/Build/Platform/VMS.pm @@ -2,7 +2,7 @@ package Module::Build::Platform::VMS; use strict; use vars qw($VERSION); -$VERSION = '0.4002'; +$VERSION = '0.4003'; $VERSION = eval $VERSION; use Module::Build::Base; use Config; diff --git a/cpan/Module-Build/lib/Module/Build/Platform/VOS.pm b/cpan/Module-Build/lib/Module/Build/Platform/VOS.pm index 25e0287..2578e31 100644 --- a/cpan/Module-Build/lib/Module/Build/Platform/VOS.pm +++ b/cpan/Module-Build/lib/Module/Build/Platform/VOS.pm @@ -2,7 +2,7 @@ package Module::Build::Platform::VOS; use strict; use vars qw($VERSION); -$VERSION = '0.4002'; +$VERSION = '0.4003'; $VERSION = eval $VERSION; use Module::Build::Base; diff --git a/cpan/Module-Build/lib/Module/Build/Platform/Windows.pm b/cpan/Module-Build/lib/Module/Build/Platform/Windows.pm index 5f6694a..e35e28f 100644 --- a/cpan/Module-Build/lib/Module/Build/Platform/Windows.pm +++ b/cpan/Module-Build/lib/Module/Build/Platform/Windows.pm @@ -2,7 +2,7 @@ package Module::Build::Platform::Windows; use strict; use vars qw($VERSION); -$VERSION = '0.4002'; +$VERSION = '0.4003'; $VERSION = eval $VERSION; use Config; diff --git a/cpan/Module-Build/lib/Module/Build/Platform/aix.pm b/cpan/Module-Build/lib/Module/Build/Platform/aix.pm index 370a052..3833ceb 100644 --- a/cpan/Module-Build/lib/Module/Build/Platform/aix.pm +++ b/cpan/Module-Build/lib/Module/Build/Platform/aix.pm @@ -2,7 +2,7 @@ package Module::Build::Platform::aix; use strict; use vars qw($VERSION); -$VERSION = '0.4002'; +$VERSION = '0.4003'; $VERSION = eval $VERSION; use Module::Build::Platform::Unix; diff --git a/cpan/Module-Build/lib/Module/Build/Platform/cygwin.pm b/cpan/Module-Build/lib/Module/Build/Platform/cygwin.pm index ec8a8fa..15d3e81 100644 --- a/cpan/Module-Build/lib/Module/Build/Platform/cygwin.pm +++ b/cpan/Module-Build/lib/Module/Build/Platform/cygwin.pm @@ -2,7 +2,7 @@ package Module::Build::Platform::cygwin; use strict; use vars qw($VERSION); -$VERSION = '0.4002'; +$VERSION = '0.4003'; $VERSION = eval $VERSION; use Module::Build::Platform::Unix; diff --git a/cpan/Module-Build/lib/Module/Build/Platform/darwin.pm b/cpan/Module-Build/lib/Module/Build/Platform/darwin.pm index ad82949..45d68fd 100644 --- a/cpan/Module-Build/lib/Module/Build/Platform/darwin.pm +++ b/cpan/Module-Build/lib/Module/Build/Platform/darwin.pm @@ -2,7 +2,7 @@ package Module::Build::Platform::darwin; use strict; use vars qw($VERSION); -$VERSION = '0.4002'; +$VERSION = '0.4003'; $VERSION = eval $VERSION; use Module::Build::Platform::Unix; diff --git a/cpan/Module-Build/lib/Module/Build/Platform/os2.pm b/cpan/Module-Build/lib/Module/Build/Platform/os2.pm index 2b28b2f..52d6e17 100644 --- a/cpan/Module-Build/lib/Module/Build/Platform/os2.pm +++ b/cpan/Module-Build/lib/Module/Build/Platform/os2.pm @@ -2,7 +2,7 @@ package Module::Build::Platform::os2; use strict; use vars qw($VERSION); -$VERSION = '0.4002'; +$VERSION = '0.4003'; $VERSION = eval $VERSION; use Module::Build::Platform::Unix; diff --git a/cpan/Module-Build/lib/Module/Build/PodParser.pm b/cpan/Module-Build/lib/Module/Build/PodParser.pm index d6724ad..6605fd4 100644 --- a/cpan/Module-Build/lib/Module/Build/PodParser.pm +++ b/cpan/Module-Build/lib/Module/Build/PodParser.pm @@ -2,7 +2,7 @@ package Module::Build::PodParser; use strict; use vars qw($VERSION); -$VERSION = '0.4002'; +$VERSION = '0.4003'; $VERSION = eval $VERSION; use vars qw(@ISA); diff --git a/cpan/Module-Build/lib/inc/latest.pm b/cpan/Module-Build/lib/inc/latest.pm index 6a9b4b7..b794c4a 100644 --- a/cpan/Module-Build/lib/inc/latest.pm +++ b/cpan/Module-Build/lib/inc/latest.pm @@ -1,7 +1,7 @@ package inc::latest; use strict; use vars qw($VERSION); -$VERSION = '0.4002'; +$VERSION = '0.4003'; $VERSION = eval $VERSION; use Carp; diff --git a/cpan/Module-Build/lib/inc/latest/private.pm b/cpan/Module-Build/lib/inc/latest/private.pm index f817ba8..2a62c57 100644 --- a/cpan/Module-Build/lib/inc/latest/private.pm +++ b/cpan/Module-Build/lib/inc/latest/private.pm @@ -1,7 +1,7 @@ package inc::latest::private; use strict; use vars qw($VERSION); -$VERSION = '0.4002'; +$VERSION = '0.4003'; $VERSION = eval $VERSION; use File::Spec; diff --git a/cpan/Module-Build/t/metadata.t b/cpan/Module-Build/t/metadata.t index fac5999..f9ce95e 100644 --- a/cpan/Module-Build/t/metadata.t +++ b/cpan/Module-Build/t/metadata.t @@ -2,7 +2,7 @@ use strict; use lib 't/lib'; -use MBTest tests => 53; +use MBTest tests => 51; blib_load('Module::Build'); blib_load('Module::Build::ConfigData'); @@ -275,7 +275,6 @@ $err = stderr_of( sub { $provides = $mb->find_dist_packages } ); is_deeply($provides, {'Simple' => { file => $simple_file, version => '1.23' }}); # XXX should be 2.34? -like( $err, qr/already declared/, ' with conflicting versions reported' ); # (Same as above three cases except with no corresponding package) @@ -294,7 +293,6 @@ $err = stderr_of( sub { $provides = $mb->find_dist_packages } ); is_deeply($provides, {'Foo' => { file => $simple_file, version => '1.23' }}); # XXX should be 2.34? -like( $err, qr/already declared/, ' with conflicting versions reported' ); # Missing version should not show up in provides as version "0" diff --git a/cpan/Module-Metadata/lib/Module/Metadata.pm b/cpan/Module-Metadata/lib/Module/Metadata.pm index ce21787..e3c2504 100644 --- a/cpan/Module-Metadata/lib/Module/Metadata.pm +++ b/cpan/Module-Metadata/lib/Module/Metadata.pm @@ -11,7 +11,7 @@ package Module::Metadata; use strict; use vars qw($VERSION); -$VERSION = '1.000010'; +$VERSION = '1.000011'; $VERSION = eval $VERSION; use Carp qw/croak/; @@ -61,7 +61,6 @@ my $VERS_REGEXP = qr{ # match a VERSION definition =[^=~] # = but not ==, nor =~ }x; - sub new_from_file { my $class = shift; my $filename = File::Spec->rel2abs( shift ); @@ -440,9 +439,49 @@ sub _parse_file { my $fh = IO::File->new( $filename ) or croak( "Can't open '$filename': $!" ); + $self->_handle_bom($fh, $filename); + $self->_parse_fh($fh); } +# Look for a UTF-8/UTF-16BE/UTF-16LE BOM at the beginning of the stream. +# If there's one, then skip it and set the :encoding layer appropriately. +sub _handle_bom { + my ($self, $fh, $filename) = @_; + + my $pos = $fh->getpos; + return unless defined $pos; + + my $buf = ' ' x 2; + my $count = $fh->read( $buf, length $buf ); + return unless defined $count and $count >= 2; + + my $encoding; + if ( $buf eq "\x{FE}\x{FF}" ) { + $encoding = 'UTF-16BE'; + } elsif ( $buf eq "\x{FF}\x{FE}" ) { + $encoding = 'UTF-16LE'; + } elsif ( $buf eq "\x{EF}\x{BB}" ) { + $buf = ' '; + $count = $fh->read( $buf, length $buf ); + if ( defined $count and $count >= 1 and $buf eq "\x{BF}" ) { + $encoding = 'UTF-8'; + } + } + + if ( defined $encoding ) { + if ( "$]" >= 5.008 ) { + # $fh->binmode requires perl 5.10 + binmode( $fh, ":encoding($encoding)" ); + } + } else { + $fh->setpos($pos) + or croak( sprintf "Can't reset position to the top of '$filename'" ); + } + + return $encoding; +} + sub _parse_fh { my ($self, $fh) = @_; @@ -456,20 +495,21 @@ sub _parse_fh { my $line_num = $.; chomp( $line ); - next if $line =~ /^\s*#/; + # From toke.c : any line that begins by "=X", where X is an alphabetic + # character, introduces a POD segment. my $is_cut; - if ( $line =~ /^=(.{0,3})/ ) { - $is_cut = $1 eq 'cut'; + if ( $line =~ /^=([a-zA-Z].*)/ ) { + my $cmd = $1; + # Then it goes back to Perl code for "=cutX" where X is a non-alphabetic + # character (which includes the newline, but here we chomped it away). + $is_cut = $cmd =~ /^cut(?:[^a-zA-Z]|$)/; $in_pod = !$is_cut; } - # Would be nice if we could also check $in_string or something too - last if !$in_pod && $line =~ /^__(?:DATA|END)__$/; - - if ( $in_pod || $is_cut ) { + if ( $in_pod ) { - if ( $line =~ /^=head\d\s+(.+)\s*$/ ) { + if ( $line =~ /^=head[1-4]\s+(.+)\s*$/ ) { push( @pod, $1 ); if ( $self->{collect_pod} && length( $pod_data ) ) { $pod{$pod_sect} = $pod_data; @@ -477,16 +517,26 @@ sub _parse_fh { } $pod_sect = $1; - } elsif ( $self->{collect_pod} ) { $pod_data .= "$line\n"; } - } else { + } elsif ( $is_cut ) { + if ( $self->{collect_pod} && length( $pod_data ) ) { + $pod{$pod_sect} = $pod_data; + $pod_data = ''; + } $pod_sect = ''; - $pod_data = ''; + + } else { + + # Skip comments in code + next if $line =~ /^\s*#/; + + # Would be nice if we could also check $in_string or something too + last if $line =~ /^__(?:DATA|END)__$/; # parse $line to see if it's a $VERSION declaration my( $vers_sig, $vers_fullname, $vers_pkg ) = @@ -497,7 +547,7 @@ sub _parse_fh { if ( $line =~ /$PKG_REGEXP/o ) { $pkg = $1; push( @pkgs, $pkg ) unless grep( $pkg eq $_, @pkgs ); - $vers{$pkg} = (defined $2 ? $2 : undef) unless exists( $vers{$pkg} ); + $vers{$pkg} = $2 unless exists( $vers{$pkg} ); $need_vers = defined $2 ? 0 : 1; # VERSION defined with full package spec, i.e. $Module::VERSION @@ -508,14 +558,6 @@ sub _parse_fh { unless ( defined $vers{$vers_pkg} && length $vers{$vers_pkg} ) { $vers{$vers_pkg} = $self->_evaluate_version_line( $vers_sig, $vers_fullname, $line ); - } else { - # Warn unless the user is using the "$VERSION = eval - # $VERSION" idiom (though there are probably other idioms - # that we should watch out for...) - warn <<"EOM" unless $line =~ /=\s*eval/; -Package '$vers_pkg' already declared with version '$vers{$vers_pkg}', -ignoring subsequent declaration on line $line_num. -EOM } # first non-comment line in undeclared package main is VERSION @@ -541,12 +583,7 @@ EOM unless ( defined $vers{$pkg} && length $vers{$pkg} ) { $vers{$pkg} = $v; - } else { - warn <<"EOM"; -Package '$pkg' already declared with version '$vers{$pkg}' -ignoring new version '$v' on line $line_num. -EOM - } + } } @@ -738,27 +775,43 @@ without executing unsafe code. =item C<< new_from_file($filename, collect_pod => 1) >> -Construct a C<Module::Metadata> object given the path to a file. Takes an -optional argument C<collect_pod> which is a boolean that determines whether POD -data is collected and stored for reference. POD data is not collected by -default. POD headings are always collected. Returns undef if the filename -does not exist. +Constructs a C<Module::Metadata> object given the path to a file. Returns +undef if the filename does not exist. + +C<collect_pod> is a optional boolean argument that determines whether POD +data is collected and stored for reference. POD data is not collected by +default. POD headings are always collected. + +If the file begins by an UTF-8, UTF-16BE or UTF-16LE byte-order mark, then +it is skipped before processing, and the content of the file is also decoded +appropriately starting from perl 5.8. =item C<< new_from_handle($handle, $filename, collect_pod => 1) >> This works just like C<new_from_file>, except that a handle can be provided -as the first argument. Note that there is no validation to confirm that the -handle is a handle or something that can act like one. Passing something that -isn't a handle will cause a exception when trying to read from it. The -C<filename> argument is mandatory or undef will be returned. +as the first argument. + +Note that there is no validation to confirm that the handle is a handle or +something that can act like one. Passing something that isn't a handle will +cause a exception when trying to read from it. The C<filename> argument is +mandatory or undef will be returned. + +You are responsible for setting the decoding layers on C<$handle> if +required. =item C<< new_from_module($module, collect_pod => 1, inc => \@dirs) >> -Construct a C<Module::Metadata> object given a module or package name. In addition -to accepting the C<collect_pod> argument as described above, this -method accepts a C<inc> argument which is a reference to an array of -of directories to search for the module. If none are given, the -default is @INC. Returns undef if the module cannot be found. +Constructs a C<Module::Metadata> object given a module or package name. +Returns undef if the module cannot be found. + +In addition to accepting the C<collect_pod> argument as described above, +this method accepts a C<inc> argument which is a reference to an array of +directories to search for the module. If none are given, the default is +@INC. + +If the file that contains the module begins by an UTF-8, UTF-16BE or +UTF-16LE byte-order mark, then it is skipped before processing, and the +content of the file is also decoded appropriately starting from perl 5.8. =item C<< find_module_by_name($module, \@dirs) >> @@ -905,7 +958,7 @@ Original code from Module::Build::ModuleInfo by Ken Williams Released as Module::Metadata by Matt S Trout (mst) <[email protected]> with assistance from David Golden (xdg) <[email protected]>. -=head1 COPYRIGHT +=head1 COPYRIGHT & LICENSE Original code Copyright (c) 2001-2011 Ken Williams. Additional code Copyright (c) 2010-2011 Matt Trout and David Golden. diff --git a/cpan/Module-Metadata/t/encoding.t b/cpan/Module-Metadata/t/encoding.t new file mode 100644 index 0000000..a0970e0 --- /dev/null +++ b/cpan/Module-Metadata/t/encoding.t @@ -0,0 +1,30 @@ +#!perl + +use strict; +use File::Spec; +use Test::More; + +use Module::Metadata; + +if ("$]" < 5.008_003) { + plan skip_all => 'Encoding test needs at least perl 5.8.3'; +} + +my %versions = ( + UTF8 => 3, + UTF16BE => 4, + UTF16LE => 5, +); + +plan tests => 4 * scalar(keys %versions); + +for my $enc (sort keys %versions) { + my $pkg = "BOMTest::$enc"; + my $vers = $versions{$enc}; + my $pm = File::Spec->catfile(qw<t lib BOMTest> => "$enc.pm"); + my $info = Module::Metadata->new_from_file($pm); + is( $info->name, $pkg, "$enc: default package was found" ); + is( $info->version, $vers, "$enc: version for default package" ); + is( $info->version('Heart'), '1', 'version for ASCII package' ); + is( $info->version("C\x{153}ur"), '2', 'version for Unicode package' ); +} diff --git a/cpan/Module-Metadata/t/lib/BOMTest/UTF16BE.pm b/cpan/Module-Metadata/t/lib/BOMTest/UTF16BE.pm new file mode 100644 index 0000000..17c6a4a Binary files /dev/null and b/cpan/Module-Metadata/t/lib/BOMTest/UTF16BE.pm differ diff --git a/cpan/Module-Metadata/t/lib/BOMTest/UTF16LE.pm b/cpan/Module-Metadata/t/lib/BOMTest/UTF16LE.pm new file mode 100644 index 0000000..a46de6d Binary files /dev/null and b/cpan/Module-Metadata/t/lib/BOMTest/UTF16LE.pm differ diff --git a/cpan/Module-Metadata/t/lib/BOMTest/UTF8.pm b/cpan/Module-Metadata/t/lib/BOMTest/UTF8.pm new file mode 100644 index 0000000..9062ac6 --- /dev/null +++ b/cpan/Module-Metadata/t/lib/BOMTest/UTF8.pm @@ -0,0 +1,13 @@ +package Heart; + +our $VERSION = 1; + +package BOMTest::UTF8; + +our $VERSION = 3; + +package CÅur; + +our $VERSION = 2; + +1; diff --git a/cpan/Module-Metadata/t/metadata.t b/cpan/Module-Metadata/t/metadata.t index 2b2d58e..b7adb1e 100644 --- a/cpan/Module-Metadata/t/metadata.t +++ b/cpan/Module-Metadata/t/metadata.t @@ -28,6 +28,15 @@ package Simple; our $VERSION; $VERSION = '1.23'; --- + '1.23' => <<'---', # commented & defined on same line +package Simple; +our $VERSION = '1.23'; # our $VERSION = '4.56'; +--- + '1.23' => <<'---', # commented & defined on separate lines +package Simple; +# our $VERSION = '4.56'; +our $VERSION = '1.23'; +--- '1.23' => <<'---', # use vars package Simple; use vars qw( $VERSION ); @@ -203,7 +212,7 @@ package Simple v1.2.3_4 { ); my %modules = reverse @modules; -plan tests => 51 + 2 * keys( %modules ); +plan tests => 54 + 2 * keys( %modules ); require_ok('Module::Metadata'); @@ -420,6 +429,9 @@ Simple - It's easy. Simple Simon +You can find me on the IRC channel +#simon on irc.perl.org. + =cut --- $dist->regen; @@ -459,13 +471,59 @@ is( $pm_info->pod('NAME'), undef, $pm_info = Module::Metadata->new_from_module( $dist->name, inc => [ 'lib', @INC ], collect_pod => 1 ); -my $name = $pm_info->pod('NAME'); -if ( $name ) { - $name =~ s/^\s+//; - $name =~ s/\s+$//; +{ + my %pod; + for my $section (qw(NAME AUTHOR)) { + my $content = $pm_info->pod( $section ); + if ( $content ) { + $content =~ s/^\s+//; + $content =~ s/\s+$//; + } + $pod{$section} = $content; + } + my %expected = ( + NAME => q|Simple - It's easy.|, + AUTHOR => <<'EXPECTED' +Simple Simon + +You can find me on the IRC channel +#simon on irc.perl.org. +EXPECTED + ); + for my $text (values %expected) { + $text =~ s/^\s+//; + $text =~ s/\s+$//; + } + is( $pod{NAME}, $expected{NAME}, 'collected NAME pod section' ); + is( $pod{AUTHOR}, $expected{AUTHOR}, 'collected AUTHOR pod section' ); } -is( $name, q|Simple - It's easy.|, 'collected pod section' ); +{ + # test things that look like POD, but aren't +$dist->change_file( 'lib/Simple.pm', <<'---' ); +package Simple; + +=YES THIS STARTS POD + +our $VERSION = '999'; + +=cute + +our $VERSION = '666'; + +=cut + +*foo +=*no_this_does_not_start_pod; + +our $VERSION = '1.23'; + +--- + $dist->regen; + $pm_info = Module::Metadata->new_from_file('lib/Simple.pm'); + is( $pm_info->name, 'Simple', 'found default package' ); + is( $pm_info->version, '1.23', 'version for default package' ); +} { # Make sure processing stops after __DATA__ diff --git a/cpan/Text-Tabs/CHANGELOG b/cpan/Text-Tabs/CHANGELOG index df83979..e72f6db 100644 --- a/cpan/Text-Tabs/CHANGELOG +++ b/cpan/Text-Tabs/CHANGELOG @@ -1,4 +1,22 @@ += 2012/08/18 + +Packaging fix. + +Minor documentation fixes. + += 2012/08/15 + +Minor fixes to test suites. + +Added back versions to support old versions of perl. + += 2009/04/17 + +Added support for Unicode combining characters to both +Text::Tabs and Text::Wrap, plus a new test suite for each +of these new functionalities. --tchrist + = 2009/03/05 Test improvements from Dave Mitchel sent back in 2005... diff --git a/cpan/Text-Tabs/lib/Text/Tabs.pm b/cpan/Text-Tabs/lib/Text/Tabs.pm index d3c06a0..34d81ab 100644 --- a/cpan/Text-Tabs/lib/Text/Tabs.pm +++ b/cpan/Text-Tabs/lib/Text/Tabs.pm @@ -6,16 +6,24 @@ require Exporter; @ISA = (Exporter); @EXPORT = qw(expand unexpand $tabstop); -use vars qw($VERSION $tabstop $debug); -$VERSION = 2009.0305; +use vars qw($VERSION $SUBVERSION $tabstop $debug); +$VERSION = 2012.0818; +$SUBVERSION = 'modern'; use strict; +use 5.010_000; + BEGIN { $tabstop = 8; $debug = 0; } +my $CHUNK = qr/\X/; + +sub _xlen (_) { scalar(() = $_[0] =~ /$CHUNK/g) } +sub _xpos (_) { _xlen( substr( $_[0], 0, pos($_[0]) ) ) } + sub expand { my @l; my $pad; @@ -24,10 +32,13 @@ sub expand { for (split(/^/m, $_, -1)) { my $offs = 0; s{\t}{ - $pad = $tabstop - (pos() + $offs) % $tabstop; + # this works on both 5.10 and 5.11 + $pad = $tabstop - (_xlen(${^PREMATCH}) + $offs) % $tabstop; + # this works on 5.11, but fails on 5.10 + #XXX# $pad = $tabstop - (_xpos() + $offs) % $tabstop; $offs += $pad - 1; " " x $pad; - }eg; + }peg; $s .= $_; } push(@l, $s); @@ -44,12 +55,12 @@ sub unexpand my $line; my @lines; my $lastbit; - my $ts_as_space = " "x$tabstop; + my $ts_as_space = " " x $tabstop; for $x (@l) { @lines = split("\n", $x, -1); for $line (@lines) { $line = expand($line); - @e = split(/(.{$tabstop})/,$line,-1); + @e = split(/(${CHUNK}{$tabstop})/,$line,-1); $lastbit = pop(@e); $lastbit = '' unless defined $lastbit; @@ -91,7 +102,7 @@ sub expand =head1 NAME -Text::Tabs -- expand and unexpand tabs per the unix expand(1) and unexpand(1) +Text::Tabs - expand and unexpand tabs like unix expand(1) and unexpand(1) =head1 SYNOPSIS @@ -103,11 +114,38 @@ Text::Tabs -- expand and unexpand tabs per the unix expand(1) and unexpand(1) =head1 DESCRIPTION -Text::Tabs does about what the unix utilities expand(1) and unexpand(1) -do. Given a line with tabs in it, expand will replace the tabs with +Text::Tabs does most of what the unix utilities expand(1) and unexpand(1) +do. Given a line with tabs in it, C<expand> replaces those tabs with the appropriate number of spaces. Given a line with or without tabs in -it, unexpand will add tabs when it can save bytes by doing so (just -like C<unexpand -a>). Invisible compression with plain ASCII! +it, C<unexpand> adds tabs when it can save bytes by doing so, +like the C<unexpand -a> command. + +Unlike the old unix utilities, this module correctly accounts for +any Unicode combining characters (such as diacriticals) that may occur +in each line for both expansion and unexpansion. These are overstrike +characters that do not increment the logical position. Make sure +you have the appropriate Unicode settings enabled. + +=head1 EXPORTS + +The following are exported: + +=over 4 + +=item expand + +=item unexpand + +=item $tabstop + +The C<$tabstop> variable controls how many column positions apart each +tabstop is. The default is 8. + +Please note that C<local($tabstop)> doesn't do the right thing and if you want +to use C<local> to override C<$tabstop>, you need to use +C<local($Text::Tabs::tabstop)>. + +=back =head1 EXAMPLE @@ -119,18 +157,36 @@ like C<unexpand -a>). Invisible compression with plain ASCII! print unexpand $_; } -Instead of the C<expand> comand, use: +Instead of the shell's C<expand> comand, use: perl -MText::Tabs -n -e 'print expand $_' -Instead of the C<unexpand -a> command, use: +Instead of the shell's C<unexpand -a> command, use: perl -MText::Tabs -n -e 'print unexpand $_' +=head1 SUBVERSION + +This module comes in two flavors: one for modern perls (5.10 and above) +and one for ancient obsolete perls. The version for modern perls has +support for Unicode. The version for old perls does not. You can tell +which version you have installed by looking at C<$Text::Tabs::SUBVERSION>: +it is C<old> for obsolete perls and C<modern> for current perls. + +This man page is for the version for modern perls and so that's probably +what you've got. + +=head1 BUGS + +Text::Tabs handles only tabs (C<"\t">) and combining characters (C</\pM/>). It doesn't +count backwards for backspaces (C<"\t">), omit other non-printing control characters (C</\pC/>), +or otherwise deal with any other zero-, half-, and full-width characters. + =head1 LICENSE Copyright (C) 1996-2002,2005,2006 David Muir Sharnoff. Copyright (C) 2005 Aristotle Pagaltzis +Copyright (C) 2012 Google, Inc. This module may be modified, used, copied, and redistributed at your own risk. Publicly redistributed modified versions must use a different name. diff --git a/cpan/Text-Tabs/lib/Text/Wrap.pm b/cpan/Text-Tabs/lib/Text/Wrap.pm index de86202..1b40ab4 100644 --- a/cpan/Text-Tabs/lib/Text/Wrap.pm +++ b/cpan/Text-Tabs/lib/Text/Wrap.pm @@ -7,16 +7,18 @@ require Exporter; @EXPORT = qw(wrap fill); @EXPORT_OK = qw($columns $break $huge); -$VERSION = 2009.0305; +$VERSION = 2012.0818; +$SUBVERSION = 'modern'; -use vars qw($VERSION $columns $debug $break $huge $unexpand $tabstop - $separator $separator2); +use 5.010_000; + +use vars qw($VERSION $SUBVERSION $columns $debug $break $huge $unexpand $tabstop $separator $separator2); use strict; BEGIN { $columns = 76; # <= screen width $debug = 0; - $break = '\s'; + $break = '(?=\s)\X'; $huge = 'wrap'; # alternatively: 'die' or 'overflow' $unexpand = 1; $tabstop = 8; @@ -24,6 +26,12 @@ BEGIN { $separator2 = undef; } +my $CHUNK = qr/\X/; + +sub _xlen(_) { scalar(() = $_[0] =~ /$CHUNK/g) } + +sub _xpos(_) { _xlen( substr( $_[0], 0, pos($_[0]) ) ) } + use Text::Tabs qw(expand unexpand); sub wrap @@ -35,14 +43,14 @@ sub wrap my $tail = pop(@t); my $t = expand(join("", (map { /\s+\z/ ? ( $_ ) : ($_, ' ') } @t), $tail)); my $lead = $ip; - my $nll = $columns - length(expand($xp)) - 1; + my $nll = $columns - _xlen(expand($xp)) - 1; if ($nll <= 0 && $xp ne '') { - my $nc = length(expand($xp)) + 2; + my $nc = _xlen(expand($xp)) + 2; warnings::warnif "Increasing \$Text::Wrap::columns from $columns to $nc to accommodate length of subsequent tab"; $columns = $nc; $nll = 1; } - my $ll = $columns - length(expand($ip)) - 1; + my $ll = $columns - _xlen(expand($ip)) - 1; $ll = 0 if $ll < 0; my $nl = ""; my $remainder = ""; @@ -51,17 +59,17 @@ sub wrap pos($t) = 0; while ($t !~ /\G(?:$break)*\Z/gc) { - if ($t =~ /\G([^\n]{0,$ll})($break|\n+|\z)/xmgc) { + if ($t =~ /\G((?:(?=[^\n])\X){0,$ll})($break|\n+|\z)/xmgc) { $r .= $unexpand ? unexpand($nl . $lead . $1) : $nl . $lead . $1; $remainder = $2; - } elsif ($huge eq 'wrap' && $t =~ /\G([^\n]{$ll})/gc) { + } elsif ($huge eq 'wrap' && $t =~ /\G((?:(?!=[^\n])\X){$ll})/gc) { $r .= $unexpand ? unexpand($nl . $lead . $1) : $nl . $lead . $1; $remainder = defined($separator2) ? $separator2 : $separator; - } elsif ($huge eq 'overflow' && $t =~ /\G([^\n]*?)($break|\n+|\z)/xmgc) { + } elsif ($huge eq 'overflow' && $t =~ /\G((?:(?=[^\n])\X)*?)($break|\n+|\z)/xmgc) { $r .= $unexpand ? unexpand($nl . $lead . $1) : $nl . $lead . $1; @@ -90,7 +98,9 @@ sub wrap print "Finish up with '$lead'\n" if $debug; - $r .= $lead . substr($t, pos($t), length($t)-pos($t)) + my($opos) = pos($t); + + $r .= $lead . substr($t, pos($t), length($t) - pos($t)) if pos($t) ne length($t); print "-----------$r---------\n" if $debug;; @@ -150,7 +160,7 @@ B<Example 2> $huge = 'overflow'; B<Example 3> - + use Text::Wrap; $Text::Wrap::columns = 72; @@ -165,14 +175,23 @@ all subsequent lines (C<$subsequent_tab>) independently. Please note: C<$initial_tab> and C<$subsequent_tab> are the literal strings that will be used: it is unlikely you would want to pass in a number. -Text::Wrap::fill() is a simple multi-paragraph formatter. It formats +C<Text::Wrap::fill()> is a simple multi-paragraph formatter. It formats each paragraph separately and then joins them together when it's done. It will destroy any whitespace in the original text. It breaks text into -paragraphs by looking for whitespace after a newline. In other respects +paragraphs by looking for whitespace after a newline. In other respects, it acts like wrap(). +C<wrap()> compresses trailing whitespace into one newline, and C<fill()> +deletes all trailing whitespace. + Both C<wrap()> and C<fill()> return a single string. +Unlike the old Unix fmt(1) utility, this module correctly accounts for +any Unicode combining characters (such as diacriticals) that may occur +in each line for both expansion and unexpansion. These are overstrike +characters that do not increment the logical position. Make sure +you have the appropriate Unicode settings enabled. + =head1 OVERRIDES C<Text::Wrap::wrap()> has a number of variables that control its behavior. @@ -250,16 +269,31 @@ Result: "This is a bit of|text that forms a|normal book-style|paragraph" +=head1 SUBVERSION + +This module comes in two flavors: one for modern perls (5.10 and above) +and one for ancient obsolete perls. The version for modern perls has +support for Unicode. The version for old perls does not. You can tell +which version you have installed by looking at C<$Text::Wrap::SUBVERSION>: +it is C<old> for obsolete perls and C<modern> for current perls. + +This man page is for the version for modern perls and so that's probably +what you've got. + =head1 SEE ALSO -For wrapping multi-byte characters: L<Text::WrapI18N>. -For more detailed controls: L<Text::Format>. +For correct handling of East Asian half- and full-width characters, +see L<Text::WrapI18N>. For more detailed controls: L<Text::Format>. + +=head1 AUTHOR + +David Muir Sharnoff <[email protected]> with help from Tim Pierce and +many many others. =head1 LICENSE -David Muir Sharnoff <[email protected]> with help from Tim Pierce and -many many others. Copyright (C) 1996-2009 David Muir Sharnoff. -This module may be modified, used, copied, and redistributed at -your own risk. Publicly redistributed versions that are modified -must use a different name. +Copyright (C) 1996-2009 David Muir Sharnoff. +Copyright (C) 2012 Google, Inc. +This module may be modified, used, copied, and redistributed at your own risk. +Publicly redistributed modified versions must use a different name. diff --git a/cpan/Text-Tabs/t/Jacobson.t b/cpan/Text-Tabs/t/Jacobson.t index d2727e4..b3465f6 100644 --- a/cpan/Text-Tabs/t/Jacobson.t +++ b/cpan/Text-Tabs/t/Jacobson.t @@ -8,7 +8,7 @@ print "1..1\n"; $huge='overflow'; $Text::Wrap::columns=9; -$break="(?<=[,.])"; +$break=".(?<=[,.])"; eval { $a=$a=wrap('','', "mmmm,n,ooo,ppp.qqqq.rrrrr,sssssssssssss,ttttttttt,uu,vvv wwwwwwwww####\n"); diff --git a/cpan/Text-Tabs/t/Jacobson2.t b/cpan/Text-Tabs/t/Jacobson2.t index b7b06fa..1bce9ed 100644 --- a/cpan/Text-Tabs/t/Jacobson2.t +++ b/cpan/Text-Tabs/t/Jacobson2.t @@ -6,7 +6,7 @@ print "1..1\n"; $huge='overflow'; $Text::Wrap::columns=9; -$break="(?<=[,.])"; +$break=".(?<=[,.])"; eval { $a=$a=wrap('','', "mmmm,n,ooo,ppp.qqqq.rrrrr.adsljasdf\nlasjdflajsdflajsdfljasdfl\nlasjdflasjdflasf,sssssssssssss,ttttttttt,uu,vvv wwwwwwwww####\n"); diff --git a/cpan/Text-Tabs/t/Tabs-ElCid.t b/cpan/Text-Tabs/t/Tabs-ElCid.t new file mode 100644 index 0000000..4208d51 --- /dev/null +++ b/cpan/Text-Tabs/t/Tabs-ElCid.t @@ -0,0 +1,176 @@ +#!perl + +BEGIN { + if ($] <= 5.010) { + print "1..0 # skip this test requires perl 5.010 or greater\n"; + exit 0; + } +} + +use strict; +use warnings "FATAL" => "all"; +use Text::Tabs; + +require bytes; + +our $Errors = 0; + +our @DATA = ( + [ # DATALINE #0 + sub { die "there is no line 0" } + ], + { # DATALINE #1 + OLD => { BYTES => 71, CHARS => 59, CHUNKS => 47, WORDS => 7, TABS => 3 }, + NEW => { BYTES => 92, CHARS => 80, CHUNKS => 68, WORDS => 7, TABS => 0 }, + }, + { # DATALINE #2 + OLD => { BYTES => 45, CHARS => 43, CHUNKS => 41, WORDS => 6, TABS => 3 }, + NEW => { BYTES => 65, CHARS => 63, CHUNKS => 61, WORDS => 6, TABS => 0 }, + }, + { # DATALINE #3 + OLD => { BYTES => 47, CHARS => 45, CHUNKS => 43, WORDS => 7, TABS => 3 }, + NEW => { BYTES => 64, CHARS => 62, CHUNKS => 60, WORDS => 7, TABS => 0 }, + }, + { # DATALINE #4 + OLD => { BYTES => 49, CHARS => 47, CHUNKS => 45, WORDS => 7, TABS => 3 }, + NEW => { BYTES => 69, CHARS => 67, CHUNKS => 65, WORDS => 7, TABS => 0 }, + }, + { # DATALINE #5 + OLD => { BYTES => 83, CHARS => 62, CHUNKS => 41, WORDS => 7, TABS => 4 }, + NEW => { BYTES => 105, CHARS => 84, CHUNKS => 63, WORDS => 7, TABS => 0 }, + }, + { # DATALINE #6 + OLD => { BYTES => 55, CHARS => 53, CHUNKS => 51, WORDS => 8, TABS => 3 }, + NEW => { BYTES => 76, CHARS => 74, CHUNKS => 72, WORDS => 8, TABS => 0 }, + }, + { # DATALINE #7 + OLD => { BYTES => 42, CHARS => 40, CHUNKS => 38, WORDS => 7, TABS => 4 }, + NEW => { BYTES => 65, CHARS => 63, CHUNKS => 61, WORDS => 7, TABS => 0 }, + }, + { # DATALINE #8 + OLD => { BYTES => 80, CHARS => 65, CHUNKS => 52, WORDS => 9, TABS => 1 }, + NEW => { BYTES => 87, CHARS => 72, CHUNKS => 59, WORDS => 9, TABS => 0 }, + }, + { # DATALINE #9 + OLD => { BYTES => 43, CHARS => 41, CHUNKS => 41, WORDS => 7, TABS => 3 }, + NEW => { BYTES => 63, CHARS => 61, CHUNKS => 61, WORDS => 7, TABS => 0 }, + }, +); + +$| = 1; +my $numtests = @DATA; +print "1..$numtests\n"; + +$Errors += table_ok(); +check_data(); + +if ($Errors) { + die "Error count: $Errors"; +} else { + exit(0); +} + + +# first some sanity checks +sub table_ok { + my $bad = 0; + for my $i ( 1 .. $#DATA ) { + + if ( $DATA[$i]{NEW}{TABS} ) { + warn "new data should have no tabs in it at table line $i"; + $bad++; + } + + if ( $DATA[$i]{NEW}{WORDS} != $DATA[$i]{OLD}{WORDS} ) { + warn "word count shouldn't change upon tab expansion at table line $i"; + $bad++; + } + } + print $bad ? "not " : "", "ok 1\n"; + return $bad; +} + +sub check($$$$) { + die "expected 4 arguments" unless @_ == 4; + my ($found, $index, $version, $item) = @_; + my $expected = $DATA[$index]{$version}{$item}; + return 1 if $found == $expected; + warn sprintf("%s line %d expected %d %s, found %d instead", + ucfirst(lc($version)), + $index, $expected, + lc($item), + $found); + return 0; +} + +sub check_data { + + binmode(DATA, ":utf8") || die "can't binmode DATA to utf8: $!"; + while ( my $_ = <DATA> ) { + + my $bad = 0; + + if ($. > $#DATA) { + die "too many lines of data"; + } + + $DATA[$.]{OLD}{DATA} = $_; + + my($char_count, $byte_count, $chunk_count, $word_count, $tab_count); + + $byte_count = bytes::length($_); + $char_count = length(); + $chunk_count = () = /\X/g; + $word_count = () = /(?:(?=\pL)\X)+/g; + $tab_count = y/\t//; + + $bad++ unless check($byte_count, $., "OLD", "BYTES"); + $bad++ unless check($char_count, $., "OLD", "CHARS"); + $bad++ unless check($chunk_count, $., "OLD", "CHUNKS"); + $bad++ unless check($word_count, $., "OLD", "WORDS"); + $bad++ unless check($tab_count, $., "OLD", "TABS"); + + $_ = expand($_); + + $DATA[$.]{NEW}{DATA} = $_; + + $byte_count = bytes::length($_); + $char_count = length(); + $chunk_count = () = /\X/g; + $word_count = () = /(?:(?=\pL)\X)+/g; + $tab_count = y/\t//; + + $bad++ unless check($byte_count, $., "NEW", "BYTES"); + $bad++ unless check($char_count, $., "NEW", "CHARS"); + $bad++ unless check($chunk_count, $., "NEW", "CHUNKS"); + $bad++ unless check($word_count, $., "NEW", "WORDS"); + $bad++ unless check($tab_count, $., "NEW", "TABS"); + + $_ = unexpand($_); + + if ($_ ne $DATA[$.]{OLD}{DATA}) { + warn "expand/unexpand round-trip equivalency failed at line $."; + warn sprintf(" Expected:\n%s\n%v02x\n But got:\n%s\n%v02x\n", + ( $DATA[$.]{OLD}{DATA} ) x 2, ($_) x 2 ); + $bad++; + } + + my $num = $. + 1; + print $bad ? "not " : "", "ok $num\n"; + $Errors += $bad; + + } + +} + + +__DATA__ + De los sos o̲j̲o̲s̲ tan fuertemientre l̲l̲o̲r̲a̲n̲d̲o̲, + tornava la cabeça i estaÌvalos catando. + Vio puertas abiertas e uços sin canÌados, + alcaÌndaras vaÌzias sin pielles e sin mantos + e s̲i̲n̲ f̲a̲l̲c̲o̲n̲e̲s̲ e s̲i̲n̲ a̲d̲t̲o̲r̲e̲s̲ mudados. + SospiroÌ mio Çid, ca mucho avie grandes cuidados. + FabloÌ mio Çid bien e tan mesurado: + âgrado a tiÌ, s̳e̳nÌ̳o̳r̳ p̳a̳d̳r̳e̳, que estaÌs en alto! + Esto me an buelto mis enemigos malos.â diff --git a/cpan/Text-Tabs/t/Wrap-JLB.t b/cpan/Text-Tabs/t/Wrap-JLB.t new file mode 100644 index 0000000..2c40379 --- /dev/null +++ b/cpan/Text-Tabs/t/Wrap-JLB.t @@ -0,0 +1,151 @@ +#!perl + +BEGIN { + if ($] <= 5.010) { + print "1..0 # skip this test requires perl 5.010 or greater\n"; + exit 0; + } +} + +use strict; +use warnings "FATAL" => "all"; +use Text::Wrap; + +$Text::Wrap::columns = 72; + +require bytes; + +our $Errors = 0; + +$/ = q(); +binmode(DATA, ":utf8") || die "can't binmode DATA to utf8: $!"; + +our @DATA = ( + [ # paragraph 0 + sub { die "there is no paragraph 0" } + ], + { # paragraph 1 + OLD => { BYTES => 44, CHARS => 44, CHUNKS => 44, WORDS => 7, TABS => 3, LINES => 4 }, + NEW => { BYTES => 44, CHARS => 44, CHUNKS => 44, WORDS => 7, TABS => 3, LINES => 4 }, + }, + { # paragraph 2 + OLD => { BYTES => 1766, CHARS => 1635, CHUNKS => 1507, WORDS => 275, TABS => 0, LINES => 2 }, + NEW => { BYTES => 1766, CHARS => 1635, CHUNKS => 1507, WORDS => 275, TABS => 0, LINES => 24 }, + }, + { # paragraph 3 + OLD => { BYTES => 157, CHARS => 148, CHUNKS => 139, WORDS => 27, TABS => 0, LINES => 2 }, + NEW => { BYTES => 157, CHARS => 148, CHUNKS => 139, WORDS => 27, TABS => 0, LINES => 3 }, + }, + { # paragraph 4 + OLD => { BYTES => 30, CHARS => 25, CHUNKS => 24, WORDS => 3, TABS => 4, LINES => 1 }, + NEW => { BYTES => 30, CHARS => 25, CHUNKS => 24, WORDS => 3, TABS => 4, LINES => 1 }, + }, +); + +$| = 1; +my $numtests = @DATA; +print "1..$numtests\n"; + +$Errors += table_ok(); +check_data(); + +if ($Errors) { + die "Error count: $Errors"; +} else { + exit(0); +} + + +# first some sanity checks +sub table_ok { + my $bad = 0; + for my $i ( 1 .. $#DATA ) { + for my $item (qw[ bytes chars chunks words tabs ]) { + if ( $DATA[$i]{NEW}{uc $item} != $DATA[$i]{OLD}{uc $item} ) { + warn "\u$item count shouldn't change upon wrapping at table paragraph $i"; + $bad++; + } + } + } + print $bad ? "not " : "", "ok 1\n"; + return $bad; +} + +sub check($$$$) { + die "expected 4 arguments" unless @_ == 4; + my ($found, $index, $version, $item) = @_; + my $expected = $DATA[$index]{$version}{$item}; + return 1 if $found == $expected; + warn sprintf("%s paragraph %d expected %d %s, found %d instead", + ucfirst(lc($version)), + $index, $expected, + lc($item), + $found); + return 0; +} + +sub check_data { + + binmode(DATA, ":utf8") || die "can't binmode DATA to utf8: $!"; + while ( my $_ = <DATA> ) { + + my $bad = 0; + + if ($. > $#DATA) { + die "too many paragraphs of data"; + } + + $DATA[$.]{OLD}{DATA} = $_; + + my($char_count, $byte_count, $chunk_count, $word_count, $tab_count, $line_count); + + $byte_count = bytes::length($_); + $char_count = length(); + $chunk_count = () = /\X/g; + $word_count = () = /(?:(?=\pL)\X)+/g; + $tab_count = y/\t//; + $line_count = y/\n//; + + $bad++ unless check($byte_count, $., "OLD", "BYTES"); + $bad++ unless check($char_count, $., "OLD", "CHARS"); + $bad++ unless check($chunk_count, $., "OLD", "CHUNKS"); + $bad++ unless check($word_count, $., "OLD", "WORDS"); + $bad++ unless check($tab_count, $., "OLD", "TABS"); + $bad++ unless check($line_count, $., "OLD", "LINES"); + + my $nl = "\n" x chomp; + + $_ = wrap("", "", $_) . $nl; + + $byte_count = bytes::length($_); + $char_count = length(); + $chunk_count = () = /\X/g; + $word_count = () = /(?:(?=\pL)\X)+/g; + $tab_count = y/\t//; + $line_count = y/\n//; + + $bad++ unless check($byte_count, $., "NEW", "BYTES"); + $bad++ unless check($char_count, $., "NEW", "CHARS"); + $bad++ unless check($chunk_count, $., "NEW", "CHUNKS"); + $bad++ unless check($word_count, $., "NEW", "WORDS"); + $bad++ unless check($tab_count, $., "NEW", "TABS"); + $bad++ unless check($line_count, $., "NEW", "LINES"); + + my $num = $. + 1; + print $bad ? "not " : "", "ok $num\n"; + $Errors += $bad; + + } + +} + +__DATA__ + Los dos reyes + y + Los dos laberintos + +Cuentan los hombres dignos de fe (pero A̳l̳aÌ̳ sabe maÌs) que en los primeros diÌas hubo un rey de l̲a̲s̲ i̲s̲l̲a̲s̲ d̲e̲ B̲a̲b̲i̲l̲o̲n̲i̲a̲ que congregoÌ a sus arquitectos ... [1565 chars truncated] + +Luego le desatoÌ las ligaduras y lo abandonoÌ en mitad del desierto, donde murioÌ de hambre y de sed. La gloria sea con A̳q̳u̳eÌ̳l̳ que no muere. + + ââJorge LuiÌs Borges diff --git a/pod/perldelta.pod b/pod/perldelta.pod index bd0de17..892e7aa 100644 --- a/pod/perldelta.pod +++ b/pod/perldelta.pod @@ -184,7 +184,7 @@ Encode::UTF7 and Encode::GSM0338. =item * -L<Module::Build> has been upgraded from version 0.40 to 0.4002. A minor bug +L<Module::Build> has been upgraded from version 0.40 to 0.4003. A minor bug fix allows markup to be used around the leading "Name" in a POD "abstract" line, and some documentation improvements have been made. @@ -201,9 +201,10 @@ Various enhancements include the new use of Module::Metadata. =item * -L<Module::Metadata> has been upgraded from version 1.000009 to 1.000010. The +L<Module::Metadata> has been upgraded from version 1.000009 to 1.000011. The creation of a Module::Metadata object for a typical module file has been sped -up by about 40%. +up by about 40%, and some spurious warnings about C<$VERSION>s have been +suppressed. =item * @@ -254,6 +255,12 @@ drive happens to contain a F<\dev\tty> file. =item * +L<Text::Tabs> and L<Text::Wrap> have been upgraded from version 2009.0305 to +2012.0818. Support for Unicode combining characters has been added to them +both. + +=item * + L<Time::Local> has been upgraded from version 1.2000 to 1.2300. Seconds values greater than 59 but less than 60 no longer cause C<timegm()> and C<timelocal()> to croak. -- Perl5 Master Repository
