summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorChris 'BinGOs' Williams <chris@bingosnet.co.uk>2015-02-06 12:00:27 +0000
committerChris 'BinGOs' Williams <chris@bingosnet.co.uk>2015-02-06 12:36:32 +0000
commit596588193775cac82eaf059a4aa065829599815a (patch)
treea9d1367baca83078bc31c642a40316ed12a4db90 /utils
parent8d28fc8f69270cc75d9564b369ac6008c5b5d617 (diff)
downloadperl-596588193775cac82eaf059a4aa065829599815a.tar.gz
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
Diffstat (limited to 'utils')
-rw-r--r--utils/Makefile.PL8
-rw-r--r--utils/encguess.PL48
2 files changed, 53 insertions, 3 deletions
diff --git a/utils/Makefile.PL b/utils/Makefile.PL
index 72f7707664..27c371f82a 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 enc2xs.PL xsubpp.PL pod2html.PL zipdetails.PL
-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 ./xsubpp ./pod2html ./zipdetails
+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 enc2xs.PL encguess.PL xsubpp.PL pod2html.PL zipdetails.PL
+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 ./encguess ./xsubpp ./pod2html ./zipdetails
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/encguess.PL b/utils/encguess.PL
new file mode 100644
index 0000000000..81322f9c21
--- /dev/null
+++ b/utils/encguess.PL
@@ -0,0 +1,48 @@
+#!/usr/local/bin/perl
+
+use Config;
+use File::Basename qw(&basename &dirname);
+use Cwd;
+
+# List explicitly here the variables you want Configure to
+# generate. Metaconfig only looks for shell variables, so you
+# have to mention them as if they were shell variables, not
+# %Config entries. Thus you write
+# $startperl
+# to ensure Configure will look for $Config{startperl}.
+
+# This forces PL files to create target in same directory as PL file.
+# This is so that make depend always knows where to find PL derivatives.
+my $origdir = cwd;
+chdir dirname($0);
+my $file = basename($0, '.PL');
+$file .= '.com' if $^O eq 'VMS';
+
+open OUT,">$file" or die "Can't create $file: $!";
+
+print "Extracting $file (with variable substitutions)\n";
+
+# In this section, perl variables will be expanded during extraction.
+# You can use $Config{...} to use Configure variables.
+
+print OUT <<"!GROK!THIS!";
+$Config{startperl}
+ eval 'exec $Config{perlpath} -S \$0 \${1+"\$@"}'
+ if \$running_under_some_shell;
+!GROK!THIS!
+
+use File::Spec;
+
+my $enc2xs = File::Spec->catfile(File::Spec->catdir(File::Spec->updir, "cpan", "Encode", "bin"), "encguess");
+
+if (open(ENC2XS, $enc2xs)) {
+ print OUT <ENC2XS>;
+ close ENC2XS;
+} else {
+ die "$0: cannot find '$enc2xs'\n";
+}
+
+close OUT or die "Can't close $file: $!";
+chmod 0755, $file or die "Can't reset permissions for $file: $!\n";
+exec("$Config{'eunicefix'} $file") if $Config{'eunicefix'} ne ':';
+chdir $origdir;