Hello community,
here is the log from the commit of package perl-Encode-Locale for
openSUSE:Factory checked in at 2015-04-22 01:07:14
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/perl-Encode-Locale (Old)
and /work/SRC/openSUSE:Factory/.perl-Encode-Locale.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "perl-Encode-Locale"
Changes:
--------
--- /work/SRC/openSUSE:Factory/perl-Encode-Locale/perl-Encode-Locale.changes
2012-02-16 16:21:51.000000000 +0100
+++
/work/SRC/openSUSE:Factory/.perl-Encode-Locale.new/perl-Encode-Locale.changes
2015-04-22 01:07:15.000000000 +0200
@@ -1,0 +2,25 @@
+Tue Apr 14 19:49:35 UTC 2015 - [email protected]
+
+- updated to 1.04
+ see /usr/share/doc/packages/perl-Encode-Locale/Changes
+
+ ## 2015-01-12 Release 1.04
+
+ Ed J (5):
+
+ * Actually include all the tests in the MANIFEST
+ * use Test::More and warnings
+ * Tidy t/alias.t
+ * t/arg.t TODO some actual ARGV testing
+ * Use Win32::GetConsoleCP/GetConsoleOutputCP if available
+
+ Gisle Aas (3):
+
+ * Documentation spell fix
+ * SEE ALSO Term::Encoding [RT#98138]
+
+ David Steinbrunner (1):
+
+ * typo fix
+
+-------------------------------------------------------------------
Old:
----
Encode-Locale-1.03.tar.gz
New:
----
Encode-Locale-1.04.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ perl-Encode-Locale.spec ++++++
--- /var/tmp/diff_new_pack.ZWnHxB/_old 2015-04-22 01:07:16.000000000 +0200
+++ /var/tmp/diff_new_pack.ZWnHxB/_new 2015-04-22 01:07:16.000000000 +0200
@@ -1,7 +1,7 @@
#
# spec file for package perl-Encode-Locale
#
-# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -17,7 +17,7 @@
Name: perl-Encode-Locale
-Version: 1.03
+Version: 1.04
Release: 0
%define cpan_name Encode-Locale
Summary: Determine the locale encoding
@@ -29,10 +29,6 @@
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: perl
BuildRequires: perl-macros
-#BuildRequires: perl(Encode::HanExtra)
-#BuildRequires: perl(Encode::Locale)
-#BuildRequires: perl(Win32::API)
-#BuildRequires: perl(Win32::Console)
Recommends: perl(Win32::Console)
%{perl_requires}
@@ -66,8 +62,8 @@
encodings known under the 'Encode' aliases "console_in" and "console_out".
For systems where we can't determine the terminal encoding these will be
aliased as the same encoding as "locale". The advice is to use "console_in"
-for input known to come from the terminal and "console_out" for output
-known to go from the terminal.
+for input known to come from the terminal and "console_out" for output to
+the terminal.
In addition to arranging for various Encode aliases the following functions
and variables are provided:
@@ -126,7 +122,7 @@
* $ENCODING_LOCALE_FS
- The encoding name determined to be suiteable for file system interfaces
+ The encoding name determined to be suitable for file system interfaces
involving file names. the Encode manpage know this encoding as
"locale_fs".
++++++ Encode-Locale-1.03.tar.gz -> Encode-Locale-1.04.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Encode-Locale-1.03/Changes
new/Encode-Locale-1.04/Changes
--- old/Encode-Locale-1.03/Changes 2012-02-11 16:51:55.000000000 +0100
+++ new/Encode-Locale-1.04/Changes 2015-01-12 22:45:41.000000000 +0100
@@ -1,3 +1,23 @@
+## 2015-01-12 Release 1.04
+
+Ed J (5):
+
+* Actually include all the tests in the MANIFEST
+* use Test::More and warnings
+* Tidy t/alias.t
+* t/arg.t TODO some actual ARGV testing
+* Use Win32::GetConsoleCP/GetConsoleOutputCP if available
+
+Gisle Aas (3):
+
+* Documentation spell fix
+* SEE ALSO Term::Encoding [RT#98138]
+
+David Steinbrunner (1):
+
+* typo fix
+
+
## 2012-01-11 Release 1.03
Documentation spelling fixes and tweaks to improve testing on Windows.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Encode-Locale-1.03/MANIFEST
new/Encode-Locale-1.04/MANIFEST
--- old/Encode-Locale-1.03/MANIFEST 2012-02-11 16:54:06.000000000 +0100
+++ new/Encode-Locale-1.04/MANIFEST 2015-01-12 22:48:39.000000000 +0100
@@ -3,6 +3,10 @@
Makefile.PL
MANIFEST This list of files
README
+t/alias.t
t/arg.t
t/env.t
-META.yml Module meta-data (added by MakeMaker)
+t/tain.t
+t/warn_once.t
+META.yml Module YAML meta-data (added by
MakeMaker)
+META.json Module JSON meta-data (added by
MakeMaker)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Encode-Locale-1.03/META.json
new/Encode-Locale-1.04/META.json
--- old/Encode-Locale-1.03/META.json 1970-01-01 01:00:00.000000000 +0100
+++ new/Encode-Locale-1.04/META.json 2015-01-12 22:48:39.000000000 +0100
@@ -0,0 +1,53 @@
+{
+ "abstract" : "Determine the locale encoding",
+ "author" : [
+ "Gisle Aas <[email protected]>"
+ ],
+ "dynamic_config" : 1,
+ "generated_by" : "ExtUtils::MakeMaker version 6.66, CPAN::Meta::Converter
version 2.133380",
+ "license" : [
+ "perl_5"
+ ],
+ "meta-spec" : {
+ "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec",
+ "version" : "2"
+ },
+ "name" : "Encode-Locale",
+ "no_index" : {
+ "directory" : [
+ "t",
+ "inc"
+ ]
+ },
+ "prereqs" : {
+ "build" : {
+ "requires" : {
+ "ExtUtils::MakeMaker" : "0",
+ "Test::More" : "0"
+ }
+ },
+ "configure" : {
+ "requires" : {
+ "ExtUtils::MakeMaker" : "0"
+ }
+ },
+ "runtime" : {
+ "recommends" : {
+ "I18N::Langinfo" : "0",
+ "Win32::Console" : "0"
+ },
+ "requires" : {
+ "Encode" : "2",
+ "Encode::Alias" : "0",
+ "perl" : "5.008"
+ }
+ }
+ },
+ "release_status" : "stable",
+ "resources" : {
+ "repository" : {
+ "url" : "http://github.com/gisle/encode-locale"
+ }
+ },
+ "version" : "1.04"
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Encode-Locale-1.03/META.yml
new/Encode-Locale-1.04/META.yml
--- old/Encode-Locale-1.03/META.yml 2012-02-11 16:54:06.000000000 +0100
+++ new/Encode-Locale-1.04/META.yml 2015-01-12 22:48:39.000000000 +0100
@@ -1,29 +1,30 @@
---- #YAML:1.0
-name: Encode-Locale
-version: 1.03
-abstract: Determine the locale encoding
+---
+abstract: 'Determine the locale encoding'
author:
- - Gisle Aas <[email protected]>
-license: perl
-distribution_type: module
-configure_requires:
- ExtUtils::MakeMaker: 0
+ - 'Gisle Aas <[email protected]>'
build_requires:
- Test: 0
-requires:
- Encode: 2
- Encode::Alias: 0
- perl: 5.008
-resources:
- repository: http://github.com/gisle/encode-locale
-no_index:
- directory:
- - t
- - inc
-generated_by: ExtUtils::MakeMaker version 6.57_05
+ ExtUtils::MakeMaker: 0
+ Test::More: 0
+configure_requires:
+ ExtUtils::MakeMaker: 0
+dynamic_config: 1
+generated_by: 'ExtUtils::MakeMaker version 6.66, CPAN::Meta::Converter version
2.133380'
+license: perl
meta-spec:
- url: http://module-build.sourceforge.net/META-spec-v1.4.html
- version: 1.4
+ url: http://module-build.sourceforge.net/META-spec-v1.4.html
+ version: 1.4
+name: Encode-Locale
+no_index:
+ directory:
+ - t
+ - inc
recommends:
- I18N::Langinfo: 0
- Win32::Console: 0
+ I18N::Langinfo: 0
+ Win32::Console: 0
+requires:
+ Encode: 2
+ Encode::Alias: 0
+ perl: 5.008
+resources:
+ repository: http://github.com/gisle/encode-locale
+version: 1.04
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Encode-Locale-1.03/Makefile.PL
new/Encode-Locale-1.04/Makefile.PL
--- old/Encode-Locale-1.03/Makefile.PL 2012-02-11 15:43:53.000000000 +0100
+++ new/Encode-Locale-1.04/Makefile.PL 2015-01-12 22:35:04.000000000 +0100
@@ -21,8 +21,8 @@
'Win32::Console' => 0,
},
},
- BUILD_REQUIRES => {
- Test => 0,
+ TEST_REQUIRES => {
+ 'Test::More' => 0,
},
);
@@ -35,10 +35,18 @@
META_ADD => 6.45,
MIN_PERL_VERSION => 6.48,
BUILD_REQUIRES => 6.56,
+ TEST_REQUIRES => 6.64,
);
undef(*WriteMakefile);
*WriteMakefile = sub {
my %arg = @_;
+ unless (eval { ExtUtils::MakeMaker->VERSION($mm_req{TEST_REQUIRES}) })
{
+ warn "Downgrading TEST_REQUIRES" if $developer;
+ $arg{BUILD_REQUIRES} = {
+ %{ $arg{BUILD_REQUIRES} },
+ %{ delete $arg{TEST_REQUIRES} },
+ };
+ }
for (keys %mm_req) {
unless (eval { ExtUtils::MakeMaker->VERSION($mm_req{$_}) }) {
warn "$_ $@" if $developer;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Encode-Locale-1.03/lib/Encode/Locale.pm
new/Encode-Locale-1.04/lib/Encode/Locale.pm
--- old/Encode-Locale-1.03/lib/Encode/Locale.pm 2012-02-11 16:50:26.000000000
+0100
+++ new/Encode-Locale-1.04/lib/Encode/Locale.pm 2015-01-12 22:46:01.000000000
+0100
@@ -1,7 +1,7 @@
package Encode::Locale;
use strict;
-our $VERSION = "1.03";
+our $VERSION = "1.04";
use base 'Exporter';
our @EXPORT_OK = qw(
@@ -25,31 +25,60 @@
unless ($ENCODING_LOCALE) {
# Try to obtain what the Windows ANSI code page is
eval {
- unless (defined &GetACP) {
+ unless (defined &GetConsoleCP) {
+ require Win32;
+ # no point falling back to Win32::GetConsoleCP from this
+ # as added same time, 0.45
+ eval { Win32::GetConsoleCP() };
+ # manually "import" it since Win32->import refuses
+ *GetConsoleCP = sub { &Win32::GetConsoleCP } unless $@;
+ }
+ unless (defined &GetConsoleCP) {
require Win32::API;
- Win32::API->Import('kernel32', 'int GetACP()');
- };
- if (defined &GetACP) {
- my $cp = GetACP();
+ Win32::API->Import('kernel32', 'int GetConsoleCP()');
+ }
+ if (defined &GetConsoleCP) {
+ my $cp = GetConsoleCP();
$ENCODING_LOCALE = "cp$cp" if $cp;
}
};
}
unless ($ENCODING_CONSOLE_IN) {
- # If we have the Win32::Console module installed we can ask
- # it for the code set to use
- eval {
- require Win32::Console;
- my $cp = Win32::Console::InputCP();
- $ENCODING_CONSOLE_IN = "cp$cp" if $cp;
- $cp = Win32::Console::OutputCP();
- $ENCODING_CONSOLE_OUT = "cp$cp" if $cp;
- };
- # Invoking the 'chcp' program might also work
- if (!$ENCODING_CONSOLE_IN && (qx(chcp) || '') =~ /^Active code
page: (\d+)/) {
- $ENCODING_CONSOLE_IN = "cp$1";
+ # only test one since set together
+ unless (defined &GetInputCP) {
+ eval {
+ require Win32;
+ eval { Win32::GetConsoleCP() };
+ # manually "import" it since Win32->import refuses
+ *GetInputCP = sub { &Win32::GetConsoleCP } unless $@;
+ *GetOutputCP = sub { &Win32::GetConsoleOutputCP } unless
$@;
+ };
+ unless (defined &GetInputCP) {
+ eval {
+ # try Win32::Console module for codepage to use
+ require Win32::Console;
+ eval { Win32::Console::InputCP() };
+ *GetInputCP = sub { &Win32::Console::InputCP }
+ unless $@;
+ *GetOutputCP = sub { &Win32::Console::OutputCP }
+ unless $@;
+ };
+ }
+ unless (defined &GetInputCP) {
+ # final fallback
+ *GetInputCP = *GetOutputCP = sub {
+ # another fallback that could work is:
+ # reg query
HKLM\System\CurrentControlSet\Control\Nls\CodePage /v ACP
+ ((qx(chcp) || '') =~ /^Active code page: (\d+)/)
+ ? $1 : ();
+ };
+ }
}
+ my $cp = GetInputCP();
+ $ENCODING_CONSOLE_IN = "cp$cp" if $cp;
+ $cp = GetOutputCP();
+ $ENCODING_CONSOLE_OUT = "cp$cp" if $cp;
}
}
@@ -206,8 +235,7 @@
under the C<Encode> aliases "console_in" and "console_out". For systems where
we can't determine the terminal encoding these will be aliased as the same
encoding as "locale". The advice is to use "console_in" for input known to
-come from the terminal and "console_out" for output known to go from the
-terminal.
+come from the terminal and "console_out" for output to the terminal.
In addition to arranging for various Encode aliases the following functions and
variables are provided:
@@ -266,7 +294,7 @@
=item $ENCODING_LOCALE_FS
-The encoding name determined to be suiteable for file system interfaces
+The encoding name determined to be suitable for file system interfaces
involving file names.
L<Encode> know this encoding as "locale_fs".
@@ -336,7 +364,7 @@
=head1 SEE ALSO
-L<I18N::Langinfo>, L<Encode>
+L<I18N::Langinfo>, L<Encode>, L<Term::Encoding>
=head1 AUTHOR
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Encode-Locale-1.03/t/alias.t
new/Encode-Locale-1.04/t/alias.t
--- old/Encode-Locale-1.03/t/alias.t 1970-01-01 01:00:00.000000000 +0100
+++ new/Encode-Locale-1.04/t/alias.t 2015-01-12 22:35:04.000000000 +0100
@@ -0,0 +1,22 @@
+#!perl -w
+
+use strict;
+use warnings;
+use Test::More tests => 8;
+
+use Encode::Locale;
+use Encode qw(find_encoding);
+
+sub cmp_encoding {
+ my ($arg, $var) = @_;
+ my $lcarg = lc $arg;
+ is find_encoding($lcarg), find_encoding(${ $Encode::Locale::{$var} }),
+ "$lcarg eq $var";
+ is find_encoding($arg), find_encoding(${ $Encode::Locale::{$var} }),
+ "$arg eq $var";
+}
+
+cmp_encoding 'Locale', 'ENCODING_LOCALE';
+cmp_encoding 'Locale_FS', 'ENCODING_LOCALE_FS';
+cmp_encoding 'Console_IN', 'ENCODING_CONSOLE_IN';
+cmp_encoding 'Console_OUT', 'ENCODING_CONSOLE_OUT';
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Encode-Locale-1.03/t/arg.t
new/Encode-Locale-1.04/t/arg.t
--- old/Encode-Locale-1.03/t/arg.t 2012-02-11 15:43:53.000000000 +0100
+++ new/Encode-Locale-1.04/t/arg.t 2015-01-12 22:35:04.000000000 +0100
@@ -1,30 +1,45 @@
#!perl -w
use strict;
-use Test;
-plan tests => 1;
+use warnings;
+use Test::More;
use Encode::Locale qw($ENCODING_LOCALE decode_argv);
+use Encode;
+use utf8;
+
+diag "ENCODING_LOCALE is $ENCODING_LOCALE\n";
+my @chars = qw(funny chars š ™);
+my @octets = map { Encode::encode(locale => $_) } @chars;
+@ARGV = @octets;
+
+plan tests => scalar(@ARGV);
-print "# ENCODING_LOCALE is $ENCODING_LOCALE\n";
decode_argv();
-my $i;
-for my $arg (@ARGV) {
- print "# ", ++$i, ": \"";
- for (split(//, $arg)) {
+TODO: {
+ local $TODO = "ARGV decoding";
+ for (my $i = 0; $i < @ARGV; $i++) {
+ is $chars[$i], $ARGV[$i],
+ "chars(" . prettify($chars[$i]) .
+ ") octets(" . prettify($octets[$i]) .
+ ") argv(" . prettify($ARGV[$i]) . ")";
+ }
+}
+
+sub prettify {
+ my $text = shift;
+ my @r;
+ for (split(//, $text)) {
if (ord() > 32 && ord() < 128) {
- print $_;
+ push @r, $_;
}
elsif (ord() < 256) {
- printf "\\x%02X", ord();
+ push @r, sprintf "\\x%02X", ord();
}
else {
- printf "\\x{%04X}", ord();
+ push @r, sprintf "\\x{%04X}", ord();
}
}
- print "\"\n";
+ join '', @r;
}
-
-# fake it :-)
-ok(1);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Encode-Locale-1.03/t/env.t
new/Encode-Locale-1.04/t/env.t
--- old/Encode-Locale-1.03/t/env.t 2012-02-11 16:43:43.000000000 +0100
+++ new/Encode-Locale-1.04/t/env.t 2015-01-12 22:35:04.000000000 +0100
@@ -1,25 +1,25 @@
#!perl -w
use strict;
-use Test;
-plan tests => 13;
+use warnings;
+use Test::More tests => 13;
use Encode::Locale qw(env);
$ENV{foo} = "bar";
-ok(env("foo"), "bar");
-ok(env("foo", "baz"), "bar");
-ok(env("foo"), "baz");
-ok($ENV{foo}, "baz");
-ok(env("foo", undef), "baz");
-ok(env("foo"), undef);
-ok(!exists $ENV{foo});
+is env("foo"), "bar", 'env read';
+is env("foo", "baz"), "bar", 'env write retval old value';
+is env("foo"), "baz", 'env write worked';
+is $ENV{foo}, "baz", 'env affected %ENV';
+is env("foo", undef), "baz", 'env write retval old value';
+is env("foo"), undef, 'env write worked';
+ok !exists $ENV{foo}, 'env write undef deletes from %ENV';
Encode::Locale::reinit("cp1252");
$ENV{"m\xf6ney"} = "\x80uro";
-ok(env("m\xf6ney", "\x{20AC}"), "\x{20AC}uro");
-ok(env("m\xf6ney"), "\x{20AC}");
-ok($ENV{"m\xf6ney"}, "\x80");
-ok(env("\x{20AC}", 1), undef);
-ok(env("\x{20AC}"), 1);
-ok($ENV{"\x80"}, 1);
+is env("m\xf6ney", "\x{20AC}"), "\x{20AC}uro", 'env write retval encoded';
+is env("m\xf6ney"), "\x{20AC}", 'env write worked';
+is $ENV{"m\xf6ney"}, "\x80", 'env affected %ENV';
+is env("\x{20AC}", 1), undef, 'env write retval old value';
+is env("\x{20AC}"), 1, 'env write worked';
+is $ENV{"\x80"}, 1, 'env affected %ENV';
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Encode-Locale-1.03/t/tain.t
new/Encode-Locale-1.04/t/tain.t
--- old/Encode-Locale-1.03/t/tain.t 1970-01-01 01:00:00.000000000 +0100
+++ new/Encode-Locale-1.04/t/tain.t 2015-01-12 22:35:04.000000000 +0100
@@ -0,0 +1,19 @@
+#!perl -Tw
+
+use strict;
+use warnings;
+
+# taint mode testing as seen in WWW::Mechanize
+
+use Test::More tests => 1;
+my @warns;
+BEGIN {
+ $SIG{__WARN__} = sub { push @warns, @_ };
+}
+BEGIN {
+ delete @ENV{qw( PATH IFS CDPATH ENV BASH_ENV )}; # Placates taint-unsafe
Cwd.pm in 5.6.1
+}
+
+require Encode::Locale;
+
+is "@warns", "", 'no warnings';
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Encode-Locale-1.03/t/warn_once.t
new/Encode-Locale-1.04/t/warn_once.t
--- old/Encode-Locale-1.03/t/warn_once.t 1970-01-01 01:00:00.000000000
+0100
+++ new/Encode-Locale-1.04/t/warn_once.t 2015-01-12 22:35:04.000000000
+0100
@@ -0,0 +1,20 @@
+#!perl -w
+
+use strict;
+use warnings;
+
+use Test::More tests => 2;
+my @warns;
+BEGIN {
+ $SIG{__WARN__} = sub { push @warns, @_ };
+}
+
+use Encode::Locale;
+
+BEGIN {
+ use Encode;
+ my $a = encode("UTF-8", "foo\xFF");
+ ok $a, "foo\xC3\xBF";
+}
+
+is "@warns", "", 'no warnings';