debian/0000755000000000000000000000000011763443177007203 5ustar debian/rules0000755000000000000000000000003611763443177010262 0ustar #!/usr/bin/make -f %: dh $@ debian/control0000644000000000000000000000205511763443177010610 0ustar Source: libconfig-simple-perl Section: perl Priority: optional Build-Depends-Indep: perl Build-Depends: debhelper (>= 8) Maintainer: Debian Perl Group Uploaders: gregor herrmann , tony mancill Standards-Version: 3.9.3 Vcs-Git: git://git.debian.org/pkg-perl/packages/libconfig-simple-perl.git Vcs-Browser: http://anonscm.debian.org/gitweb/?p=pkg-perl/packages/libconfig-simple-perl.git Homepage: http://search.cpan.org/dist/Config-Simple Package: libconfig-simple-perl Architecture: all Depends: ${perl:Depends}, ${misc:Depends} Description: simple configuration file class Reading and writing configuration files is one of the most frequent aspects of any software design. Config::Simple is the library to help you with it. . Config::Simple is a class representing configuration file object. It supports several configuration file syntax and tries to identify the file syntax to parse them accordingly. Library supports parsing, updating and creating configuration files. debian/source/0000755000000000000000000000000011763443177010503 5ustar debian/source/format0000644000000000000000000000001411763443177011711 0ustar 3.0 (quilt) debian/changelog0000644000000000000000000001052511763443177011060 0ustar libconfig-simple-perl (4.59-6) unstable; urgency=low * Move to the Debian Perl Group on maintainer's request. * debian/control: Added: Vcs-Git field (source stanza). Removed: Vcs- Svn field (source stanza). Changed: Maintainer set to Debian Perl Group (was: tony mancill ); tony mancill moved to Uploaders; Vcs-Browser (source stanza). * debian/copyright: Replace DEP5 Format-Specification URL from svn.debian.org to anonscm.debian.org URL. * Update patch headers. * debian/copyright: update to Copyright-Format 1.0. * Update years of packaging copyright, refresh license stanzas. * Bump Standards-Version to 3.9.3 (no changes). * Set debhelper compatibility level to 8. -- gregor herrmann Tue, 05 Jun 2012 19:48:41 +0200 libconfig-simple-perl (4.59-5) unstable; urgency=low * Replace empty_value.patch (which broke at least publican) with empty_string.patch, provided by Raphaël Hertzog - thanks! Closes: #593043. -- gregor herrmann Mon, 16 Aug 2010 17:42:18 +0200 libconfig-simple-perl (4.59-4) unstable; urgency=low [ gregor herrmann ] * Add patch non_word_chars.patch to make the ini-parser work with non "word" characters; thanks to Stefan Denker for the bug report (closes: #546534). * Change debhelper compatibility level to 7, adjust debian/{rules,compat,control}, add ${misc:Depends} to Depends. * Don't install README anymore, just a text version of the POD documentation. * Remove version from perl build dependency, fulfilled even in oldstable. * Change my email address. * debian/watch: use extended regexp for matching upstream releases. * debian/copyright: add information about packaging. * Convert to source format 3.0 (quilt). Remove quilt framework. * debian/copyright: update formatting (DEP5) and years of packaging copyright. * Set Standards-Version to 3.9.1 (no changes). [ tony mancill ] * debian/control: Update Vcs-Browser link. -- tony mancill Thu, 05 Aug 2010 21:23:43 -0700 libconfig-simple-perl (4.59-3) unstable; urgency=low * Add Homepage field to debian/control. * Change XS-Vcs-* fields to Vcs-*. * Change URL in debian/watch. * Set Standards-Version to 3.7.3 (no changes needed). * debian/rules: - move tests to build target - use DESTDIR and PREFIX on make install - remove some commented out and unsused dh_* calls - create install-stamp target - remove OPTIMIZE variable, we don't compile anything - remove DESTDIR for installing the package - use $(CURDIR) instead of `pwd` * Change debian/copyright to the new machine-readable format. * Remove /usr/lib/perl5 only if it exists; prevents a FTBFS under perl 5.10. * Set debhelper compatibility level to 6. -- gregor herrmann Tue, 22 Jan 2008 17:31:07 +0100 libconfig-simple-perl (4.59-2) unstable; urgency=low * Add XS-Vcs-Svn and XS-Vcs-Browser fields to debian/control. * Set debhelper compatibility level to 5. * Don't ignore errors of ($MAKE) realclean) in debian/rules. * Remove empty /usr/lib/perl5 directory from binary package. * Enable tests in debian/rules. * Fix watch file. * Add myself to Uploaders. -- gregor herrmann Mon, 13 Aug 2007 20:18:35 +0200 libconfig-simple-perl (4.59-1) unstable; urgency=low * New upstream release -- tony mancill Mon, 11 Jun 2007 22:07:05 -0700 libconfig-simple-perl (4.58-2) unstable; urgency=low * bump standards version to 3.7.2 * fix build-depends -- tony mancill Mon, 11 Jun 2007 21:58:04 -0700 libconfig-simple-perl (4.58-1) unstable; urgency=low * new upstream release - bug-fix for comment lines with leading spaces * added debian/watch -- tony mancill Sat, 16 Apr 2005 22:33:15 -0700 libconfig-simple-perl (4.57-1) unstable; urgency=low * new upstream release * import_from now closes config file after reading (closes: #293735) (thanks to Anthony DeRobertis) -- tony mancill Sat, 5 Feb 2005 09:30:01 -0800 libconfig-simple-perl (4.55-1) unstable; urgency=low * Initial Release. (closes: #229839) -- tony mancill Fri, 23 Jan 2004 11:07:20 -0800 debian/compat0000644000000000000000000000000211763443177010401 0ustar 8 debian/patches/0000755000000000000000000000000011763443177010632 5ustar debian/patches/non_word_chars.patch0000644000000000000000000000674111763443177014670 0ustar Description: change regexp for splitting "key = value" pairs in the ini style parser, otherwise it chokes on non "word" chars Bug: http://rt.cpan.org/Public/Bug/Display.html?id=49682 Forwarded: http://rt.cpan.org/Public/Bug/Display.html?id=49682 Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=546534 Author: gregor herrmann Last-Update: 2012-06-05 --- a/Simple.pm +++ b/Simple.pm @@ -287,7 +287,7 @@ # parsing the block name: $line =~ /^\s*\[\s*([^\]]+)\s*\]$/ and $bn = lcase($1), next; # parsing key/value pairs - $line =~ /^\s*([^=]*\w)\s*=\s*(.*)\s*$/ and $data{$bn}->{lcase($1)}=[parse_line(READ_DELIM, 0, $2)], next; + $line =~ /^\s*([^=]+?)\s*=\s*(.*)\s*$/ and $data{$bn}->{lcase($1)}=[parse_line(READ_DELIM, 0, $2)], next; # if we came this far, the syntax couldn't be validated: $errstr = "syntax error on line $. '$line'"; return undef; --- /dev/null +++ b/t/colors.ini @@ -0,0 +1,10 @@ +; Config::Simple 4.59 +; Mon Sep 14 21:02:18 CEST 2009 + +[colors] +average (2009) = blue +average (2009 = blue +average (2009)a = blue +average (2010)=blue +average (2010=blue +average (2010)a=blue --- /dev/null +++ b/t/colors.t @@ -0,0 +1,62 @@ +#!/usr/bin/perl -w +# Before `make install' is performed this script should be runnable with +# `make test'. After `make install' it should work as `perl 1.t' + +######################### + +use strict; +use Test; +use Data::Dumper; +use FindBin '$RealBin'; +use File::Spec; +BEGIN { + plan tests => 30; +} + +use Config::Simple; +ok(1); +######################### + +# Insert your test code below, the Test::More module is use()ed here so read +# its man page ( perldoc Test::More ) for help writing this test script. + +my $ini_file = File::Spec->catfile($RealBin, 'colors.ini'); + +my $cfg = new Config::Simple(); +ok($cfg); +ok($cfg->read($ini_file)); +ok($cfg->param('colors.average (2009)') eq 'blue'); +ok($cfg->param('colors.average (2009') eq 'blue'); +ok($cfg->param('colors.average (2009)a') eq 'blue'); +ok($cfg->param('colors.average (2010)') eq 'blue'); +ok($cfg->param('colors.average (2010') eq 'blue'); +ok($cfg->param('colors.average (2010)a') eq 'blue'); +ok($cfg->block() == 1); +my $vars = $cfg->vars(); +ok($vars->{'colors.average (2009)'} eq 'blue'); +ok($vars->{'colors.average (2009'} eq 'blue'); +ok($vars->{'colors.average (2009)a'} eq 'blue'); +ok($vars->{'colors.average (2010)'} eq 'blue'); +ok($vars->{'colors.average (2010'} eq 'blue'); +ok($vars->{'colors.average (2010)a'} eq 'blue'); +ok($cfg->param(-name=>'colors.average (2009)', -value =>'blue')); +ok($cfg->param(-name=>'colors.average (2009', -value =>'blue')); +ok($cfg->param(-name=>'colors.average (2009)a', -value =>'blue')); +ok($cfg->param(-name=>'colors.average (2010)', -value =>'blue')); +ok($cfg->param(-name=>'colors.average (2010', -value =>'blue')); +ok($cfg->param(-name=>'colors.average (2010)a', -value =>'blue')); + +# testing get_block(): +ok( ref($cfg->param(-block=>'colors')) eq 'HASH' ); +ok( $cfg->param(-block=>'colors')->{'average (2009)'} eq 'blue'); +ok( $cfg->param(-block=>'colors')->{'average (2009'} eq 'blue'); +ok( $cfg->param(-block=>'colors')->{'average (2009)a'} eq 'blue'); +ok( $cfg->param(-block=>'colors')->{'average (2010)'} eq 'blue'); +ok( $cfg->param(-block=>'colors')->{'average (2010'} eq 'blue'); +ok( $cfg->param(-block=>'colors')->{'average (2010)a'} eq 'blue'); + +# now testing the new syntax: +my $data = Config::Simple->parse_ini_file($ini_file); +ok(ref($data) eq 'HASH'); + + debian/patches/empty_string.patch0000644000000000000000000000104111763443177014373 0ustar Description: If the array is empty, we return an empty string. Origin: vendor Bug-Debian: http://bugs.debian.org/593043 Bug: https://rt.cpan.org/Ticket/Display.html?id=77642 Forwarded: https://rt.cpan.org/Ticket/Display.html?id=77642 Author: Raphaël Hertzog Reviewed-by: gregor herrmann Last-Update: 2012-06-05 --- a/Simple.pm +++ b/Simple.pm @@ -471,6 +471,7 @@ } defined($rv) or return; + return "" if scalar(@$rv) == 0; for ( my $i=0; $i < @$rv; $i++ ) { $rv->[$i] =~ s/\\n/\n/g; debian/patches/series0000644000000000000000000000005011763443177012042 0ustar non_word_chars.patch empty_string.patch debian/copyright0000644000000000000000000000223211763443177011135 0ustar Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: Config-Simple Upstream-Contact: Sherzod B. Ruzmetov URI: http://author.handalak.com Source: http://search.cpan.org/dist/Config-Simple/ Files: * Copyright: 2002-2003, Sherzod B. Ruzmetov License: Artistic or GPL-1+ Files: debian/* Copyright: 2004-2012, tony mancill 2007-2012, gregor herrmann License: Artistic or GPL-1+ License: Artistic This program is free software; you can redistribute it and/or modify it under the terms of the Artistic License, which comes with Perl. . On Debian systems, the complete text of the Artistic License can be found in `/usr/share/common-licenses/Artistic'. License: GPL-1+ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 1, or (at your option) any later version. . On Debian systems, the complete text of version 1 of the GNU General Public License can be found in `/usr/share/common-licenses/GPL-1'. debian/watch0000644000000000000000000000016511763443177010236 0ustar version=3 http://search.cpan.org/dist/Config-Simple/ .*/Config-Simple-v?(\d[\d.-]+)\.(?:tar(?:\.gz|\.bz2)?|tgz|zip)$