In perl.git, the branch blead has been updated

<http://perl5.git.perl.org/perl.git/commitdiff/596588193775cac82eaf059a4aa065829599815a?hp=8d28fc8f69270cc75d9564b369ac6008c5b5d617>

- Log -----------------------------------------------------------------
commit 596588193775cac82eaf059a4aa065829599815a
Author: Chris 'BinGOs' Williams <[email protected]>
Date:   Fri Feb 6 12:00:27 2015 +0000

    Update Encode to CPAN version 2.70
    
      [DELTA]
    
    $Revision: 2.70 $ $Date: 2015/02/05 10:53:00 $
    ! Makefile.PL
      add bin/encguess to EXE_FILES
    
    2.69 2015/02/05 10:35:11
    ! bin/encguess
      Refactored so that
      * does not depend on non-core module (File::Slurp in particular)
      * PODified document
      * -s "encA encB" to -s encA,encB which is more shell-friendly
      * and more
    ! MANIFEST
    + bin/encguess
      Pulled: Added CLI wrapper for Encode::Guess
      https://github.com/dankogai/p5-encode/pull/32
    ! Unicode/Unicode.pm
      Pulled: Bump $VERSION in module changed since Encode-2.60
      https://github.com/dankogai/p5-encode/pull/31
-----------------------------------------------------------------------

Summary of changes:
 MANIFEST                         |   2 +
 Porting/Maintainers.pl           |   4 +-
 configure.com                    |   1 +
 cpan/Encode/Encode.pm            |   4 +-
 cpan/Encode/Encode.xs            |   2 +-
 cpan/Encode/Makefile.PL          |   3 +-
 cpan/Encode/Unicode/Unicode.pm   |   2 +-
 cpan/Encode/bin/encguess         | 145 +++++++++++++++++++++++++++++++++++++++
 t/porting/customized.dat         |   1 -
 t/porting/known_pod_issues.dat   |   4 +-
 utils.lst                        |   1 +
 utils/Makefile.PL                |   8 ++-
 utils/{enc2xs.PL => encguess.PL} |   2 +-
 vms/descrip_mms.template         |   5 +-
 win32/Makefile                   |   3 +-
 win32/makefile.mk                |   3 +-
 16 files changed, 173 insertions(+), 17 deletions(-)
 create mode 100644 cpan/Encode/bin/encguess
 copy utils/{enc2xs.PL => encguess.PL} (96%)

diff --git a/MANIFEST b/MANIFEST
index cc62528..d779cbe 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -784,6 +784,7 @@ cpan/Digest/t/file.t                See if Digest 
extensions work
 cpan/Digest/t/lib/Digest/Dummy.pm              See if Digest extensions work
 cpan/Digest/t/security.t               See if Digest extensions work
 cpan/Encode/bin/enc2xs         Encode module generator
+cpan/Encode/bin/encguess               guess character encodings of files
 cpan/Encode/bin/piconv         iconv by perl
 cpan/Encode/bin/ucm2table      Table Generator for testing
 cpan/Encode/bin/ucmlint                A UCM Lint utility
@@ -5625,6 +5626,7 @@ utils/c2ph.PL                     program to translate 
dbx stabs to perl
 utils/corelist.PL              Module::CoreList
 utils/cpan.PL                  easily interact with CPAN from the command line
 utils/enc2xs.PL                        Encode module generator
+utils/encguess.PL                      guess character encodings of files
 utils/h2ph.PL                  A thing to turn C .h files into perl .ph files
 utils/h2xs.PL                  Program to make .xs files from C header files
 utils/instmodsh.PL             Give information about installed extensions
diff --git a/Porting/Maintainers.pl b/Porting/Maintainers.pl
index 5c38b84..5c174df 100755
--- a/Porting/Maintainers.pl
+++ b/Porting/Maintainers.pl
@@ -392,14 +392,12 @@ use File::Glob qw(:case);
     },
 
     'Encode' => {
-        'DISTRIBUTION' => 'DANKOGAI/Encode-2.68.tar.gz',
+        'DISTRIBUTION' => 'DANKOGAI/Encode-2.70.tar.gz',
         'FILES'        => q[cpan/Encode],
         'CUSTOMIZED'   => [
             # Waiting to be merged upstream if it smokes ok: see CPAN 
RT#100347,
             # in particular see khw's comments on that ticket on 21 Nov 2014.
             qw( encoding.pm ),
-            # Waiting to be merged upstream: see pull request #31
-            qw( Unicode/Unicode.pm ),
         ],
     },
 
diff --git a/configure.com b/configure.com
index 5636713..c70cf7b 100644
--- a/configure.com
+++ b/configure.com
@@ -7409,6 +7409,7 @@ $ WRITE CONFIG "$ c2ph       == """ + perl_setup_perl + " 
''vms_prefix':[utils]c
 $ WRITE CONFIG "$ corelist   == """ + perl_setup_perl + " 
''vms_prefix':[utils]corelist.com"""
 $ WRITE CONFIG "$ cpan       == """ + perl_setup_perl + " 
''vms_prefix':[utils]cpan.com"""
 $ WRITE CONFIG "$ enc2xs     == """ + perl_setup_perl + " 
''vms_prefix':[utils]enc2xs.com"""
+$ WRITE CONFIG "$ encguess   == """ + perl_setup_perl + " 
''vms_prefix':[utils]encguess.com"""
 $ WRITE CONFIG "$ find2perl  == """ + perl_setup_perl + " 
''vms_prefix':[utils]find2perl.com"""
 $ WRITE CONFIG "$ h2ph       == """ + perl_setup_perl + " 
''vms_prefix':[utils]h2ph.com"""
 $ WRITE CONFIG "$ h2xs       == """ + perl_setup_perl + " 
''vms_prefix':[utils]h2xs.com"""
diff --git a/cpan/Encode/Encode.pm b/cpan/Encode/Encode.pm
index c34e997..7a9135c 100644
--- a/cpan/Encode/Encode.pm
+++ b/cpan/Encode/Encode.pm
@@ -1,10 +1,10 @@
 #
-# $Id: Encode.pm,v 2.68 2015/01/22 10:17:32 dankogai Exp dankogai $
+# $Id: Encode.pm,v 2.70 2015/02/05 10:52:16 dankogai Exp $
 #
 package Encode;
 use strict;
 use warnings;
-our $VERSION = sprintf "%d.%02d", q$Revision: 2.68 $ =~ /(\d+)/g;
+our $VERSION = sprintf "%d.%02d", q$Revision: 2.70 $ =~ /(\d+)/g;
 use constant DEBUG => !!$ENV{PERL_ENCODE_DEBUG};
 use XSLoader ();
 XSLoader::load( __PACKAGE__, $VERSION );
diff --git a/cpan/Encode/Encode.xs b/cpan/Encode/Encode.xs
index 7ec8d44..73f64a8 100644
--- a/cpan/Encode/Encode.xs
+++ b/cpan/Encode/Encode.xs
@@ -1,5 +1,5 @@
 /*
- $Id: Encode.xs,v 2.33 2015/01/22 10:17:32 dankogai Exp dankogai $
+ $Id: Encode.xs,v 2.33 2015/01/22 10:17:32 dankogai Exp $
  */
 
 #define PERL_NO_GET_CONTEXT
diff --git a/cpan/Encode/Makefile.PL b/cpan/Encode/Makefile.PL
index 18d5915..8193de3 100644
--- a/cpan/Encode/Makefile.PL
+++ b/cpan/Encode/Makefile.PL
@@ -1,5 +1,5 @@
 #
-# $Id: Makefile.PL,v 2.12 2013/09/14 07:51:59 dankogai Exp $
+# $Id: Makefile.PL,v 2.13 2015/02/05 10:53:00 dankogai Exp dankogai $
 #
 use 5.007003;
 use strict;
@@ -23,6 +23,7 @@ my %tables =
 
 my @exe_files = qw(bin/enc2xs
            bin/piconv
+           bin/encguess
            );
 my @more_exe_files = qw(
             unidump
diff --git a/cpan/Encode/Unicode/Unicode.pm b/cpan/Encode/Unicode/Unicode.pm
index 75da3d7..6b35cb7 100644
--- a/cpan/Encode/Unicode/Unicode.pm
+++ b/cpan/Encode/Unicode/Unicode.pm
@@ -4,7 +4,7 @@ use strict;
 use warnings;
 no warnings 'redefine';
 
-our $VERSION = do { my @r = ( q$Revision: 2.10 $ =~ /\d+/g ); sprintf "%d." . 
"%02d" x $#r, @r };
+our $VERSION = do { my @r = ( q$Revision: 2.9 $ =~ /\d+/g ); sprintf "%d." . 
"%02d" x $#r, @r };
 
 use XSLoader;
 XSLoader::load( __PACKAGE__, $VERSION );
diff --git a/cpan/Encode/bin/encguess b/cpan/Encode/bin/encguess
new file mode 100644
index 0000000..5d7ac80
--- /dev/null
+++ b/cpan/Encode/bin/encguess
@@ -0,0 +1,145 @@
+#!./perl
+use 5.008001;
+use strict;
+use warnings;
+use Encode;
+use Getopt::Std;
+use Carp;
+use Encode::Guess;
+$Getopt::Std::STANDARD_HELP_VERSION = 1;
+
+my %opt;
+getopts( "huSs:", \%opt );
+my @suspect_list;
+list_valid_suspects() and exit if $opt{S};
+@suspect_list = split /:,/, $opt{s} if $opt{s};
+HELP_MESSAGE() if $opt{h};
+HELP_MESSAGE() unless @ARGV;
+do_guess($_) for @ARGV;
+
+sub read_file {
+    my $filename = shift;
+    local $/;
+    open my $fh, '<:raw', $filename or croak "$filename:$!";
+    my $content = <$fh>;
+    close $fh;
+    return $content;
+}
+
+sub do_guess {
+    my $filename = shift;
+    my $data     = read_file($filename);
+    my $enc      = guess_encoding( $data, @suspect_list );
+    if ( !ref($enc) && $opt{u} ) {
+        return 1;
+    }
+    print "$filename\t";
+    if ( ref($enc) ) {
+        print $enc->mime_name();
+    }
+    else {
+        print "unknown";
+    }
+    print "\n";
+    return 1;
+}
+
+sub list_valid_suspects {
+    print join( "\n", Encode->encodings(":all") );
+    print "\n";
+    return 1;
+}
+
+sub HELP_MESSAGE {
+    exec 'pod2usage', $0 or die "pod2usage: $!" 
+}
+__END__
+=head1 NAME
+
+encguess - guess character encodings of files
+
+=head1 VERSION
+
+$Id: encguess,v 0.1 2015/02/05 10:34:19 dankogai Exp $
+
+=head1 SYNOPSIS
+
+  encguess [switches] filename...
+
+=head2 SWITCHES
+
+=over 2
+
+=item -h
+
+show this message and exit.
+
+=item -s
+
+specify a list of "suspect encoding types" to test, 
+seperated by either C<:> or C<,>
+
+=item -S
+
+output a list of all acceptable encoding types that can be used with
+the -s param
+
+=item -u
+
+suppress display of unidentified types
+
+=back
+
+=head2 EXAMPLES:
+
+=over 2
+
+=item *
+
+Guess encoding of a file named C<test.txt>, using only the default
+suspect types.
+
+   encguess test.txt
+
+=item *
+
+Guess the encoding type of a file named C<test.txt>, using the suspect
+types C<euc-jp,shiftjis,7bit-jis>.
+
+   encguess -s euc-jp,shiftjis,7bit-jis test.txt
+   encguess -s euc-jp:shiftjis:7bit-jis test.txt
+
+=item *
+
+Guess the encoding type of several files, do not display results for
+unidentified files.
+
+   encguess -us euc-jp,shiftjis,7bit-jis test*.txt
+
+=back
+
+=head1 DESCRIPTION
+
+The encoding identification is done by checking one encoding type at a
+time until all but the right type are eliminated. The set of encoding
+types to try is defined by the -s parameter and defaults to ascii,
+utf8 and UTF-16/32 with BOM. This can be overridden by passing one or
+more encoding types via the -s parameter. If you need to pass in
+multiple suspect encoding types, use a quoted string with the a space
+separating each value.
+
+=head1 SEE ALSO
+
+L<Encode::Guess>, L<Encode::Detect>
+
+=head1 LICENSE AND COPYRIGHT
+
+Copyright 2015 Michael LaGrasta and Dan Kogai.
+
+This program is free software; you can redistribute it and/or modify it
+under the terms of the the Artistic License (2.0). You may obtain a
+copy of the full license at:
+
+L<http://www.perlfoundation.org/artistic_license_2_0>
+
+=cut
diff --git a/t/porting/customized.dat b/t/porting/customized.dat
index 9b6063e..b2b33ba 100644
--- a/t/porting/customized.dat
+++ b/t/porting/customized.dat
@@ -7,7 +7,6 @@ CPAN cpan/CPAN/lib/CPAN/Index.pm 
73aee30450127c5ac4dc05abc2c10a8accd4b198
 CPAN cpan/CPAN/lib/CPAN/LWP/UserAgent.pm 
e09525b0c2377c5ac28b7fad1b6d70c57e343913
 CPAN cpan/CPAN/lib/CPAN/Mirrors.pm 580e74746abaf1628d533015d5b529d82a470af4
 Encode cpan/Encode/encoding.pm baa25e197ba4d5fa228dbf7b440afb5ae18ec5ed
-Encode cpan/Encode/Unicode/Unicode.pm 3ba3aeffd03c89c40195a189a98f7e47a11c2a11
 ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/t/pm_to_blib.t 
71ebcee355691ce374fcad251b12d8b2412462b3
 PerlIO::via::QuotedPrint cpan/PerlIO-via-QuotedPrint/t/QuotedPrint.t 
ca39f0146e89de02c746e199c45dcb3e5edad691
 Pod::Parser cpan/Pod-Parser/lib/Pod/PlainText.pm 
f0b490545b4e52e141450d1192d0ca00bd8d7a82
diff --git a/t/porting/known_pod_issues.dat b/t/porting/known_pod_issues.dat
index 03377f8..268fc15 100644
--- a/t/porting/known_pod_issues.dat
+++ b/t/porting/known_pod_issues.dat
@@ -1,4 +1,4 @@
-# This file is the data file for t/porting/podcheck.t.
+# This file is the data file for porting/podcheck.t.
 # There are three types of lines.
 # Comment lines are white-space only or begin with a '#', like this one.  Any
 #   changes you make to the comment lines will be lost when the file is
@@ -314,6 +314,8 @@ porting/expand-macro.pl     Verbatim line length including 
indents exceeds 79 by    2
 porting/release_managers_guide.pod     Verbatim line length including indents 
exceeds 79 by    6
 porting/todo.pod       Verbatim line length including indents exceeds 79 by    
7
 utils/c2ph     Verbatim line length including indents exceeds 79 by    44
+utils/encguess Apparent broken link    1
+utils/encguess There is no NAME        1
 lib/benchmark.pm       Verbatim line length including indents exceeds 79 by    
2
 lib/config.pod ? Should you be using L<...> instead of -1
 lib/extutils/embed.pm  Verbatim line length including indents exceeds 79 by    
2
diff --git a/utils.lst b/utils.lst
index c108c4a..216a9d0 100644
--- a/utils.lst
+++ b/utils.lst
@@ -7,6 +7,7 @@ utils/c2ph      # link = utils/pstruct
 utils/cpan
 utils/corelist
 utils/enc2xs
+utils/encguess
 utils/h2ph
 utils/h2xs
 utils/instmodsh
diff --git a/utils/Makefile.PL b/utils/Makefile.PL
index 72f7707..27c371f 100644
--- a/utils/Makefile.PL
+++ b/utils/Makefile.PL
@@ -35,9 +35,9 @@ print $fh <<'EOT';
 # Files to be built with variable substitution after miniperl is
 # available.  Dependencies handled manually below (for now).
 
-pl = c2ph.PL corelist.PL cpan.PL h2ph.PL h2xs.PL instmodsh.PL json_pp.PL 
perlbug.PL perldoc.PL perlivp.PL pl2pm.PL prove.PL ptar.PL ptardiff.PL 
ptargrep.PL shasum.PL splain.PL libnetcfg.PL piconv.PL  ... [45 chars truncated]
-plextract = c2ph corelist cpan h2ph h2xs instmodsh json_pp perlbug perldoc 
perlivp pl2pm prove ptar ptardiff ptargrep shasum splain libnetcfg piconv 
enc2xs xsubpp pod2html zipdetails
-plextractexe = ./c2ph ./corelist ./cpan ./h2ph ./h2xs ./json_pp ./instmodsh 
./perlbug ./perldoc ./perlivp ./pl2pm ./prove ./ptar ./ptardiff ./ptargrep 
./shasum ./splain ./libnetcfg ./piconv ./enc2xs  ... [32 chars truncated]
+pl = c2ph.PL corelist.PL cpan.PL h2ph.PL h2xs.PL instmodsh.PL json_pp.PL 
perlbug.PL perldoc.PL perlivp.PL pl2pm.PL prove.PL ptar.PL ptardiff.PL 
ptargrep.PL shasum.PL splain.PL libnetcfg.PL piconv.PL  ... [57 chars truncated]
+plextract = c2ph corelist cpan h2ph h2xs instmodsh json_pp perlbug perldoc 
perlivp pl2pm prove ptar ptardiff ptargrep shasum splain libnetcfg piconv 
enc2xs encguess xsubpp pod2html zipdetails
+plextractexe = ./c2ph ./corelist ./cpan ./h2ph ./h2xs ./json_pp ./instmodsh 
./perlbug ./perldoc ./perlivp ./pl2pm ./prove ./ptar ./ptardiff ./ptargrep 
./shasum ./splain ./libnetcfg ./piconv ./enc2xs  ... [43 chars truncated]
 
 all: $(plextract) 
 
@@ -84,6 +84,8 @@ piconv:               piconv.PL ../config.sh
 
 enc2xs:                enc2xs.PL ../config.sh
 
+enc2xs:                encguess.PL ../config.sh
+
 xsubpp:                xsubpp.PL ../config.sh
 
 zipdetails:    zipdetails.PL ../config.sh
diff --git a/utils/enc2xs.PL b/utils/encguess.PL
similarity index 96%
copy from utils/enc2xs.PL
copy to utils/encguess.PL
index 8e3bb35..81322f9 100644
--- a/utils/enc2xs.PL
+++ b/utils/encguess.PL
@@ -33,7 +33,7 @@ $Config{startperl}
 
 use File::Spec;
 
-my $enc2xs = File::Spec->catfile(File::Spec->catdir(File::Spec->updir, "cpan", 
"Encode", "bin"), "enc2xs");
+my $enc2xs = File::Spec->catfile(File::Spec->catdir(File::Spec->updir, "cpan", 
"Encode", "bin"), "encguess");
 
 if (open(ENC2XS, $enc2xs)) {
     print OUT <ENC2XS>;
diff --git a/vms/descrip_mms.template b/vms/descrip_mms.template
index 69dcc2e..505ab84 100644
--- a/vms/descrip_mms.template
+++ b/vms/descrip_mms.template
@@ -285,7 +285,7 @@ utils1 = [.utils]perldoc.com [.utils]c2ph.com 
[.utils]h2ph.com
 utils2 = [.utils]h2xs.com [.utils]libnetcfg.com [.lib]perlbug.com 
[.utils]json_pp.com
 utils3 = [.utils]perlivp.com [.lib]splain.com [.utils]pl2pm.com 
[.utils]xsubpp.com [.utils]pod2html.com [.utils]instmodsh.com
 utils4 = [.utils]enc2xs.com [.utils]piconv.com [.utils]cpan.com 
[.utils]prove.com [.utils]ptar.com [.utils]ptardiff.com [.utils]shasum.com
-utils5 = [.utils]corelist.com [.utils]ptargrep.com [.utils]zipdetails.com
+utils5 = [.utils]corelist.com [.utils]ptargrep.com [.utils]zipdetails.com 
[.utils]encguess.com
 
 all : base extras archcorefiles preplibrary [.pod]perltoc.pod
        @ QUALIFIERS := $(MMSQUALIFIERS)
@@ -473,6 +473,9 @@ nonxsext : $(LIBPREREQ) preplibrary $(MINIPERL_EXE) 
[.pod]perlfunc.pod
 [.utils]enc2xs.com : [.utils]enc2xs.PL $(ARCHDIR)Config.pm
        $(MINIPERL) -"I[-.lib]" $(MMS$SOURCE)
 
+[.utils]encguess.com : [.utils]encguess.PL $(ARCHDIR)Config.pm
+       $(MINIPERL) -"I[-.lib]" $(MMS$SOURCE)
+
 [.utils]h2ph.com : [.utils]h2ph.PL $(ARCHDIR)Config.pm
        $(MINIPERL) -"I[-.lib]" $(MMS$SOURCE)
 
diff --git a/win32/Makefile b/win32/Makefile
index 8076ce6..bc13bd2 100644
--- a/win32/Makefile
+++ b/win32/Makefile
@@ -623,6 +623,7 @@ UTILS               =                       \
                ..\utils\perlivp        \
                ..\utils\libnetcfg      \
                ..\utils\enc2xs         \
+               ..\utils\encguess               \
                ..\utils\piconv         \
                ..\utils\corelist       \
                ..\utils\cpan           \
@@ -1260,7 +1261,7 @@ distclean: realclean
            perltru64.pod perltw.pod perluniprops.pod perlvos.pod \
            perlwin32.pod
        -cd ..\utils && del /f h2ph splain perlbug pl2pm c2ph pstruct h2xs \
-           perldoc perlivp libnetcfg enc2xs piconv cpan *.bat \
+           perldoc perlivp libnetcfg enc2xs encguess piconv cpan *.bat \
            xsubpp pod2html instmodsh json_pp prove ptar ptardiff ptargrep 
shasum corelist zipdetails
        -del /f ..\config.sh perlmain.c dlutils.c config.h.new \
                perlmainst.c
diff --git a/win32/makefile.mk b/win32/makefile.mk
index f275a8e..d1d0bb8 100644
--- a/win32/makefile.mk
+++ b/win32/makefile.mk
@@ -757,6 +757,7 @@ UTILS               =                       \
                ..\utils\perlivp        \
                ..\utils\libnetcfg      \
                ..\utils\enc2xs         \
+               ..\utils\encguess               \
                ..\utils\piconv         \
                ..\utils\corelist       \
                ..\utils\cpan           \
@@ -1547,7 +1548,7 @@ distclean: realclean
            perltru64.pod perltw.pod perluniprops.pod perlvos.pod \
            perlwin32.pod
        -cd ..\utils && del /f h2ph splain perlbug pl2pm c2ph pstruct h2xs \
-           perldoc perlivp libnetcfg enc2xs piconv cpan *.bat \
+           perldoc perlivp libnetcfg enc2xs encguess piconv cpan *.bat \
            xsubpp pod2html instmodsh json_pp prove ptar ptardiff ptargrep 
shasum corelist zipdetails
        -del /f ..\config.sh perlmain.c dlutils.c config.h.new \
            perlmainst.c

--
Perl5 Master Repository

Reply via email to