Hello community,
here is the log from the commit of package perl-Config-Grammar for
openSUSE:Factory checked in at 2016-02-17 10:26:36
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/perl-Config-Grammar (Old)
and /work/SRC/openSUSE:Factory/.perl-Config-Grammar.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "perl-Config-Grammar"
Changes:
--------
--- /work/SRC/openSUSE:Factory/perl-Config-Grammar/perl-Config-Grammar.changes
2012-01-04 07:26:19.000000000 +0100
+++
/work/SRC/openSUSE:Factory/.perl-Config-Grammar.new/perl-Config-Grammar.changes
2016-02-17 12:19:29.000000000 +0100
@@ -1,0 +2,11 @@
+Tue Feb 9 09:36:45 UTC 2016 - [email protected]
+
+- updated to 1.11
+ see /usr/share/doc/packages/perl-Config-Grammar/Changes
+
+ 2016-02-08
+
+ * Released 1.11
+ * Allow specification of file encoding (Fritz Zaucker)
+
+-------------------------------------------------------------------
Old:
----
Config-Grammar-1.10.tar.gz
New:
----
Config-Grammar-1.11.tar.gz
cpanspec.yml
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ perl-Config-Grammar.spec ++++++
--- /var/tmp/diff_new_pack.tZgYJk/_old 2016-02-17 12:19:29.000000000 +0100
+++ /var/tmp/diff_new_pack.tZgYJk/_new 2016-02-17 12:19:29.000000000 +0100
@@ -1,7 +1,7 @@
#
# spec file for package perl-Config-Grammar
#
-# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# Copyright (c) 2016 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,29 +17,30 @@
Name: perl-Config-Grammar
-Version: 1.10
+Version: 1.11
Release: 0
%define cpan_name Config-Grammar
-Summary: A grammar-based, user-friendly config parser
+Summary: Grammar-Based, User-Friendly Config Parser
License: Artistic-1.0 or GPL-1.0+
Group: Development/Libraries/Perl
Url: http://search.cpan.org/dist/Config-Grammar/
-Source:
http://www.cpan.org/authors/id/D/DS/DSCHWEI/%{cpan_name}-%{version}.tar.gz
+Source0:
http://www.cpan.org/authors/id/D/DS/DSCHWEI/%{cpan_name}-%{version}.tar.gz
+Source1: cpanspec.yml
BuildArch: noarch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: perl
BuildRequires: perl-macros
-#BuildRequires: perl(Config::Grammar)
-#BuildRequires: perl(Config::Grammar::Document)
-#BuildRequires: perl(Config::Grammar::Dynamic)
-#BuildRequires: perl(DebugDump)
%{perl_requires}
%description
-Config::Grammar is a module to parse configuration files. The configuration
-may consist of multiple-level sections with assignments and tabular data.
-The parsed data will be returned as a hash containing the whole
-configuration. Config::Grammar uses a grammar that is supplied upon
+Config::Grammar is a module to parse configuration files. The optional
+second parameter to the parse() method can be used to specify the file
+encoding to use for opening the file (see documentation for Perl's use open
+pragma).
+
+The configuration may consist of multiple-level sections with assignments
+and tabular data. The parsed data will be returned as a hash containing the
+whole configuration. Config::Grammar uses a grammar that is supplied upon
creation of a Config::Grammar object to parse the configuration file and
return helpful error messages in case of syntax errors. Using the *makepod*
method you can generate documentation of the configuration file format.
++++++ Config-Grammar-1.10.tar.gz -> Config-Grammar-1.11.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Config-Grammar-1.10/Changes
new/Config-Grammar-1.11/Changes
--- old/Config-Grammar-1.10/Changes 2007-09-25 16:59:58.000000000 +0200
+++ new/Config-Grammar-1.11/Changes 2016-02-08 21:32:38.000000000 +0100
@@ -1,5 +1,10 @@
Revision history for Perl extension Config::Grammar.
+2016-02-08
+
+ * Released 1.11
+ * Allow specification of file encoding (Fritz Zaucker)
+
2007-09-25
* Released 1.10
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Config-Grammar-1.10/META.yml
new/Config-Grammar-1.11/META.yml
--- old/Config-Grammar-1.10/META.yml 2007-09-25 17:16:23.000000000 +0200
+++ new/Config-Grammar-1.11/META.yml 2016-02-08 21:33:03.000000000 +0100
@@ -1,10 +1,21 @@
-# http://module-build.sourceforge.net/META-spec.html
-#XXXXXXX This is a prototype!!! It will change in the future!!! XXXXX#
-name: Config-Grammar
-version: 1.10
-version_from: lib/Config/Grammar.pm
-installdirs: site
-requires:
-
-distribution_type: module
-generated_by: ExtUtils::MakeMaker version 6.30_01
+--- #YAML:1.0
+name: Config-Grammar
+version: 1.11
+abstract: A grammar-based, user-friendly config parser
+author:
+ - David Schweikert
+license: unknown
+distribution_type: module
+configure_requires:
+ ExtUtils::MakeMaker: 0
+build_requires:
+ ExtUtils::MakeMaker: 0
+requires: {}
+no_index:
+ directory:
+ - t
+ - inc
+generated_by: ExtUtils::MakeMaker version 6.57_05
+meta-spec:
+ url: http://module-build.sourceforge.net/META-spec-v1.4.html
+ version: 1.4
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Config-Grammar-1.10/lib/Config/Grammar.pm
new/Config-Grammar-1.11/lib/Config/Grammar.pm
--- old/Config-Grammar-1.10/lib/Config/Grammar.pm 2007-09-25
16:55:20.000000000 +0200
+++ new/Config-Grammar-1.11/lib/Config/Grammar.pm 2016-02-08
21:31:25.000000000 +0100
@@ -1,7 +1,7 @@
package Config::Grammar;
use strict;
-$Config::Grammar::VERSION = '1.10';
+$Config::Grammar::VERSION = '1.11';
sub new($$)
{
@@ -582,10 +582,13 @@
my $self = shift;
my $file = shift;
- local *File;
unless ($file) { $self->{'err'} = "no filename given" ;
return undef;};
- open(File, "$file") or do {
+
+ my $fh;
+ my $mode = "<";
+ $mode .= ":encoding($self->{encoding})" if $self->{encoding};
+ open($fh, $mode, "$file") or do {
$self->{'err'} = "can't open $file: $!";
return undef;
};
@@ -593,7 +596,7 @@
local $_;
my $source = '';
- while (<File>) {
+ while (<$fh>) {
$source .= $_;
chomp;
s/^\s+//;
@@ -602,7 +605,7 @@
next if $_ eq ''; # empty lines
while (/\\$/) {# continuation
s/\\$//;
- my $n = <File>;
+ my $n = <$fh>;
last if not defined $n;
chomp $n;
$n =~ s/^\s+//;
@@ -614,7 +617,7 @@
$self->_parse_line($_, $source) or do{ close File; return 0; };
$source = '';
}
- close File;
+ close $fh;
return 1;
}
@@ -645,10 +648,13 @@
return $pod;
}
-sub parse($$)
+sub parse($$$)
{
- my $self = shift;
- my $file = shift;
+ my $self = shift;
+ my $file = shift;
+ my $args = shift;
+
+ $self->{encoding} = $args->{encoding};
$self->{cfg} = {};
$self->{level} = 0;
@@ -683,21 +689,26 @@
use Config::Grammar;
+ my $args = { encoding => 'utf8' }; # the second paramter to parse() is
optional
my $parser = Config::Grammar->new(\%grammar);
- my $cfg = $parser->parse('app.cfg') or die "ERROR: $parser->{err}\n";
+ my $cfg = $parser->parse('app.cfg', $args) or die "ERROR: $parser->{err}\n";
my $pod = $parser->makepod();
my $ex = $parser->maketmpl('TOP','SubNode');
my $minex = $parser->maketmplmin('TOP','SubNode');
=head1 DESCRIPTION
-Config::Grammar is a module to parse configuration files. The
-configuration may consist of multiple-level sections with assignments
-and tabular data. The parsed data will be returned as a hash
-containing the whole configuration. Config::Grammar uses a grammar
-that is supplied upon creation of a Config::Grammar object to parse
-the configuration file and return helpful error messages in case of
-syntax errors. Using the B<makepod> method you can generate
+Config::Grammar is a module to parse configuration files. The optional
+second parameter to the parse() method can be used to specify the file
+encoding to use for opening the file (see documentation for Perl's use
+open pragma).
+
+The configuration may consist of multiple-level sections with
+assignments and tabular data. The parsed data will be returned as a
+hash containing the whole configuration. Config::Grammar uses a
+grammar that is supplied upon creation of a Config::Grammar object to
+parse the configuration file and return helpful error messages in case
+of syntax errors. Using the B<makepod> method you can generate
documentation of the configuration file format.
The B<maketmpl> method can generate a template configuration file. If
@@ -1004,7 +1015,8 @@
},
});
- my $cfg = $parser->parse('test.cfg') or
+ my $args = { encoding => 'utf8' }; # the second paramter to parse() is
optional
+ my $cfg = $parser->parse('test.cfg', $args) or
die "ERROR: $parser->{err}\n";
print Dumper($cfg);
print $parser->makepod;
++++++ cpanspec.yml ++++++
---
#description_paragraphs: 3
#description: |-
# override description from CPAN
#summary: override summary from CPAN
#no_testing: broken upstream
#sources:
# - source1
# - source2
#patches:
# foo.patch: -p1
# bar.patch:
#preamble: |-
# BuildRequires: gcc-c++
#post_prep: |-
# hunspell=`pkg-config --libs hunspell | sed -e 's,-l,,; s, *,,g'`
# sed -i -e "s,hunspell-X,$hunspell," t/00-prereq.t Makefile.PL
#post_build: |-
# rm unused.files
#post_install: |-
# sed on %{name}.files
#license: SUSE-NonFree
#skip_noarch: 1
#custom_build: |-
#./Build build flags=%{?_smp_mflags} --myflag
#custom_test: |-
#startserver && make test
#ignore_requires: Bizarre::Module