r49146 - in /trunk/libconfig-augeas-perl: Build.PL ChangeLog META.yml debian/changelog debian/control debian/copyright debian/libconfig-augeas-perl.docs debian/rules lib/Config/Augeas.pm lib/Config/Augeas.xs t/Config-Augeas.t t/Config-AugeasC.t

jawnsy-guest at users.alioth.debian.org jawnsy-guest at users.alioth.debian.org
Tue Dec 22 03:44:58 UTC 2009


Author: jawnsy-guest
Date: Tue Dec 22 03:44:51 2009
New Revision: 49146

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=49146
Log:
* New upstream release
* Rewrote control description
* Added myself to Uploaders and Copyright
* Use new short debhelper rules format
* Standards-Version 3.8.3 (drop perl version dep)
* No longer install README

Removed:
    trunk/libconfig-augeas-perl/debian/libconfig-augeas-perl.docs
Modified:
    trunk/libconfig-augeas-perl/Build.PL
    trunk/libconfig-augeas-perl/ChangeLog
    trunk/libconfig-augeas-perl/META.yml
    trunk/libconfig-augeas-perl/debian/changelog
    trunk/libconfig-augeas-perl/debian/control
    trunk/libconfig-augeas-perl/debian/copyright
    trunk/libconfig-augeas-perl/debian/rules
    trunk/libconfig-augeas-perl/lib/Config/Augeas.pm
    trunk/libconfig-augeas-perl/lib/Config/Augeas.xs
    trunk/libconfig-augeas-perl/t/Config-Augeas.t
    trunk/libconfig-augeas-perl/t/Config-AugeasC.t

Modified: trunk/libconfig-augeas-perl/Build.PL
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libconfig-augeas-perl/Build.PL?rev=49146&op=diff
==============================================================================
--- trunk/libconfig-augeas-perl/Build.PL (original)
+++ trunk/libconfig-augeas-perl/Build.PL Tue Dec 22 03:44:51 2009
@@ -54,11 +54,13 @@
 my $aug_version = `pkg-config --modversion augeas` ;
 chomp($aug_cflags, $aug_libs, $aug_version) ;
 
-if (   not defined $aug_version or ( $aug_version lt '0.5.0')) {
+my $min_version = '0.6.0' ;
+
+if (   not defined $aug_version or ( $aug_version lt $min_version)) {
     warn << "EOW2" ;
 ***
 *** 'pkg-config' did find augeas version $aug_version but 
-*** version 0.5.0 minimum is required
+*** version $min_version minimum is required
 ***
 EOW2
     exit 0;

Modified: trunk/libconfig-augeas-perl/ChangeLog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libconfig-augeas-perl/ChangeLog?rev=49146&op=diff
==============================================================================
--- trunk/libconfig-augeas-perl/ChangeLog (original)
+++ trunk/libconfig-augeas-perl/ChangeLog Tue Dec 22 03:44:51 2009
@@ -1,7 +1,15 @@
+2009-12-21  Dominique Dumont  <domi.dumont at free.fr> v0.601
+
+	* lib/Config/Augeas.pm : Added methods load, error, error_message,
+	error_minor_message and error_details
+
+	* lib/Config/Augeas.xs : Added interface for aug_load and
+	aug_error* from Augeas 0.6.0
+
 2009-07-10  Dominique Dumont  <dominique.dumont at hp.com> v0.501
 
 	* Build.PL: modified gcc options to issue more warnings (and fixed
-	them 
+	them
 
 	* lib/Config/Augeas.xs: Fixed compiler warnings (Thanks to
 	Guillaume Rousse)
@@ -27,7 +35,7 @@
 	* t/Config-AugeasC.t: Removed test involving AUGROOT environment
 	variable (Lead to FTBS on Debian amd64). The removed tests are
 	already performed passing augeas root through aug_init.
- 	
+
 2008-11-21  Dominique Dumont  <dominique.dumont at hp.com> v0.304
 
 	* lib/Config/Augeas.pm (print): Improved print method. Can now

Modified: trunk/libconfig-augeas-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libconfig-augeas-perl/META.yml?rev=49146&op=diff
==============================================================================
--- trunk/libconfig-augeas-perl/META.yml (original)
+++ trunk/libconfig-augeas-perl/META.yml Tue Dec 22 03:44:51 2009
@@ -1,6 +1,6 @@
 ---
 name: Config-Augeas
-version: 0.501
+version: 0.601
 author:
   - Dominique Dumont (ddumont at cpan dot org)
 abstract: Edit configuration files through Augeas C library
@@ -9,12 +9,14 @@
   license: http://opensource.org/licenses/lgpl-license.php
 build_requires:
   Test::More: 0
+configure_requires:
+  Module::Build: 0.35
 dynamic_config: 1
 provides:
   Config::Augeas:
     file: lib/Config/Augeas.pm
-    version: 0.501
-generated_by: Module::Build version 0.33
+    version: 0.601
+generated_by: Module::Build version 0.35
 meta-spec:
   url: http://module-build.sourceforge.net/META-spec-v1.4.html
   version: 1.4

Modified: trunk/libconfig-augeas-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libconfig-augeas-perl/debian/changelog?rev=49146&op=diff
==============================================================================
--- trunk/libconfig-augeas-perl/debian/changelog (original)
+++ trunk/libconfig-augeas-perl/debian/changelog Tue Dec 22 03:44:51 2009
@@ -1,9 +1,18 @@
-libconfig-augeas-perl (0.501-2) UNRELEASED; urgency=low
+libconfig-augeas-perl (0.601-1) UNRELEASED; urgency=low
 
+  [ Jonathan Yu ]
+  * New upstream release
+  * Rewrote control description
+  * Added myself to Uploaders and Copyright
+  * Use new short debhelper rules format
+  * Standards-Version 3.8.3 (drop perl version dep)
+  * No longer install README
+
+  [ gregor herrmann ]
   * debian/control: Changed: (build-)depend on perl instead of perl-
     modules.
 
- -- gregor herrmann <gregoa at debian.org>  Fri, 23 Oct 2009 02:24:16 +0200
+ -- Jonathan Yu <jawnsy at cpan.org>  Mon, 21 Dec 2009 19:13:39 -0500
 
 libconfig-augeas-perl (0.501-1) unstable; urgency=low
 

Modified: trunk/libconfig-augeas-perl/debian/control
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libconfig-augeas-perl/debian/control?rev=49146&op=diff
==============================================================================
--- trunk/libconfig-augeas-perl/debian/control (original)
+++ trunk/libconfig-augeas-perl/debian/control Tue Dec 22 03:44:51 2009
@@ -1,28 +1,24 @@
 Source: libconfig-augeas-perl
 Section: perl
 Priority: optional
-Build-Depends: debhelper (>= 7), 
-	       perl (>= 5.10) | libmodule-build-perl,
-	       perl (>= 5.8.8-12), 
-	       libaugeas-dev (>= 0.5.0), 
-	       pkg-config,
-	       libtest-pod-perl
+Build-Depends: debhelper (>= 7), perl (>= 5.10) | libmodule-build-perl,
+ libaugeas-dev (>= 0.5.0), pkg-config, libtest-pod-perl
 Maintainer: Debian Perl Group <pkg-perl-maintainers at lists.alioth.debian.org>
 Uploaders: Dominique Dumont <dominique.dumont at hp.com>,
- gregor herrmann <gregoa at debian.org>
+ gregor herrmann <gregoa at debian.org>, Jonathan Yu <jawnsy at cpan.org>
+Standards-Version: 3.8.3
 Vcs-Svn: svn://svn.debian.org/svn/pkg-perl/trunk/libconfig-augeas-perl
 Vcs-Browser: http://svn.debian.org/viewsvn/pkg-perl/trunk/libconfig-augeas-perl/
-Standards-Version: 3.8.2
 Homepage: http://search.cpan.org/dist/Config-Augeas/
 
 Package: libconfig-augeas-perl
 Architecture: any
 Depends: ${perl:Depends}, ${shlibs:Depends}, ${misc:Depends}
-Description: Perl module which allows to edit configuration files through Augeas
- Augeas is a library and command line tool that focuses on the most basic
- problem in handling Linux configurations programmatically: editing actual
- configuration files in a controlled manner.
+Description: module that allows to edit configuration files through Augeas
+ Config::Augeas is a Perl module that provides an object-oriented interface to
+ the Augeas open source configuration library. The API is more "Perlish" than
+ its C counterpart, making it natural to use with Perl.
  .
- Config::Augeas provides an object oriented Perl interface for Augeas
- configuration edition library with a more "perlish" API than Augeas C
- counterpart.
+ Augeas is a library and command line tool that addresses the common problem
+ of handling configuration data, providing a means to easily edit many types
+ of configuration files. (See the augeas package for details)

Modified: trunk/libconfig-augeas-perl/debian/copyright
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libconfig-augeas-perl/debian/copyright?rev=49146&op=diff
==============================================================================
--- trunk/libconfig-augeas-perl/debian/copyright (original)
+++ trunk/libconfig-augeas-perl/debian/copyright Tue Dec 22 03:44:51 2009
@@ -1,24 +1,24 @@
 Format-Specification:
     http://wiki.debian.org/Proposals/CopyrightFormat?action=recall&rev=196
-Upstream-Maintainer: Dominique Dumont (ddumont at cpan dot org)
+Upstream-Maintainer: Dominique Dumont <ddumont at cpan.org>
 Upstream-Source: http://search.cpan.org/dist/Config-Augeas/
 Upstream-Name: Config-Augeas
 
 Files: *
-Copyright: 2008-2009, Dominique Dumont (ddumont at cpan dot org)
+Copyright: 2008-2009, Dominique Dumont <ddumont at cpan.org>
 License: LGPL-2+
 
 Files: lib/Config/ppport.h
-Copyright:
- Version 3.x, Copyright (c) 2004-2007, Marcus Holland-Moritz.
- Version 2.x, Copyright (C) 2001, Paul Marquess.
- Version 1.x, Copyright (C) 1999, Kenneth Albanowski.
+Copyright: 2004-2009, Marcus Holland-Moritz <mhx-cpan at gmx.net>
+ 2001, Paul Marquess <pmqs at cpan.org> (Version 2.x)
+ 1999, Kenneth Albanowski <kjahds at kjahds.com> (Version 1.x)
 License-Alias: Perl
 License: Artistic | GPL-1+
 
 Files: debian/*
 Copyright: 2008-2009, Dominique Dumont <dominique.dumont at hp.com>
  2009, gregor herrmann <gregoa at debian.org>
+ 2009, Jonathan Yu <jawnsy at cpan.org>
 License: LGPL-2+
 
 License: LGPL-2+

Modified: trunk/libconfig-augeas-perl/debian/rules
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libconfig-augeas-perl/debian/rules?rev=49146&op=diff
==============================================================================
--- trunk/libconfig-augeas-perl/debian/rules (original)
+++ trunk/libconfig-augeas-perl/debian/rules Tue Dec 22 03:44:51 2009
@@ -1,23 +1,4 @@
 #!/usr/bin/make -f
 
-build: build-stamp
-build-stamp:
-	dh build
-	touch $@
-
-clean:
+%:
 	dh $@
-
-install: install-stamp
-install-stamp: build-stamp
-	dh install
-	touch $@
-
-binary-arch: install
-	dh $@
-
-binary-indep:
-
-binary: binary-arch binary-indep
-
-.PHONY: binary binary-arch binary-indep install clean build

Modified: trunk/libconfig-augeas-perl/lib/Config/Augeas.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libconfig-augeas-perl/lib/Config/Augeas.pm?rev=49146&op=diff
==============================================================================
--- trunk/libconfig-augeas-perl/lib/Config/Augeas.pm (original)
+++ trunk/libconfig-augeas-perl/lib/Config/Augeas.pm Tue Dec 22 03:44:51 2009
@@ -22,7 +22,7 @@
 use Carp;
 use IO::File ;
 
-our $VERSION = '0.501';
+our $VERSION = '0.601';
 
 require XSLoader;
 XSLoader::load('Config::Augeas', $VERSION);
@@ -386,6 +386,43 @@
     return $ret == 0 ? 1 : 0 ;
 }
 
+=head2 load
+
+Load files into the tree. Which files to load and what lenses to use on
+them is specified under C</augeas/load> in the tree; each entry
+C</augeas/load/NAME> specifies a 'transform', by having itself exactly one
+child 'lens' and any number of children labelled 'incl' and 'excl'. The
+value of NAME has no meaning.
+
+The 'lens' grandchild of C</augeas/load> specifies which lens to use, and
+can either be the fully qualified name of a lens 'Module.lens' or
+'C<@Module>'. The latter form means that the lens from the transform marked
+for autoloading in C<MODULE> should be used.
+
+The 'incl' and 'excl' grandchildren of C</augeas/load> indicate which files
+to transform. Their value are used as glob patterns. Any file that
+matches at least one 'incl' pattern and no 'excl' pattern is
+transformed. The order of 'incl' and 'excl' entries is irrelevant.
+
+When L<init> is first called, it populates C</augeas/load> with the
+transforms marked for autoloading in all the modules it finds.
+
+Before loading any files, C<load> will remove everything underneath
+C</augeas/files> and C</files>, regardless of whether any entries have been
+modified or not.
+
+Returns 0 on error, 1 on success. Note that success includes the case
+where some files could not be loaded. Details of such files can be found
+as 'C</augeas//error>'.
+
+=cut
+
+sub load {
+    my $self   = shift ;
+    my $ret = $self->{aug_c} -> load() ;
+    return $ret == 0 ? 1 : 0 ;
+}
+
 =head2 print ( [ path  , [ file ] ] )
 
 Print each node matching C<path> and its descendants on STDOUT or in a file
@@ -412,8 +449,7 @@
   $aug->print('/files') ; # print all file nodes to STDOUT
   $aug->print('/augeas/','bar.txt'); # print Augeas meta data in bar.txt
 
-WARNING: The orders of the parameter are reversed compared to Augeas C
-API.
+WARNING: The parameter order is reversed compared to Augeas C API.
 
 =cut
 
@@ -436,9 +472,69 @@
     return $ret == 0 ? 1 : 0 ;
 }
 
+=head1 Error reporting
+
+=head2 error
+
+Returns the error code from the last API call as a short string:
+noerror, nomem, internal, pathx, nomatch, manymatch, syntax
+
+=cut
+
+my @errcode = qw/noerror nomem internal pathx nomatch manymatch syntax/;
+
+sub error {
+    my $self   = shift ;
+    my $code = $self->{aug_c} -> error() ;
+    return $errcode[$code] ;
+}
+
+=head2 error_message
+
+Return a human-readable message for the error code.
+
+=cut
+
+sub error_message {
+  my $self   = shift ;
+  $self->{aug_c} -> error_message() ;
+}
+
+=head2 error_minor_message
+
+Return a human-readable message elaborating the error code; might be
+undef. For example, when the error code is C<pathx>, this will explain
+how the path expression is invalid.
+
+=cut
+
+sub error_minor_message {
+  my $self   = shift ;
+  $self->{aug_c} -> error_minor_message() ;
+}
+
+=head2 error_details
+
+Return details about the error, which might be undef. For example, for
+C<pathx>, indicates where in the path expression the error
+occurred. The returned value can only be used until the next API call
+
+=cut
+
+sub error_details {
+  my $self   = shift ;
+  $self->{aug_c} -> error_details() ;
+}
+
 1;
 
 __END__
+
+=head1 CAVEATS
+
+Object oriented design would suggest to use a new class to represent
+Augeas errors, but this would stray too far from current Augeas design
+and API.
 
 =head1 SEE ALSO
 

Modified: trunk/libconfig-augeas-perl/lib/Config/Augeas.xs
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libconfig-augeas-perl/lib/Config/Augeas.xs?rev=49146&op=diff
==============================================================================
--- trunk/libconfig-augeas-perl/lib/Config/Augeas.xs (original)
+++ trunk/libconfig-augeas-perl/lib/Config/Augeas.xs Tue Dec 22 03:44:51 2009
@@ -41,7 +41,7 @@
 BOOT:
   {
     HV *stash;
-    stash = gv_stashpv("Config::Augeas", TRUE);
+    stash	       = gv_stashpv("Config::Augeas", TRUE);
     newCONSTSUB(stash, "AUG_NONE",         newSViv(AUG_NONE));
     newCONSTSUB(stash, "AUG_SAVE_BACKUP",  newSViv(AUG_SAVE_BACKUP));
     newCONSTSUB(stash, "AUG_SAVE_NEWFILE", newSViv(AUG_SAVE_NEWFILE));
@@ -49,6 +49,18 @@
     newCONSTSUB(stash, "AUG_NO_STDINC",    newSViv(AUG_NO_STDINC));
     newCONSTSUB(stash, "AUG_SAVE_NOOP",    newSViv(AUG_SAVE_NOOP));
     newCONSTSUB(stash, "AUG_NO_LOAD",      newSViv(AUG_NO_LOAD));
+    newCONSTSUB(stash, "AUG_NO_MODL_AUTOLOAD", newSViv(AUG_NO_MODL_AUTOLOAD));
+
+
+    /* Error reporting */
+    newCONSTSUB(stash, "AUG_NOERROR",   newSViv(AUG_NOERROR));
+    newCONSTSUB(stash, "AUG_ENOMEM",    newSViv(AUG_ENOMEM));
+    newCONSTSUB(stash, "AUG_EINTERNAL", newSViv(AUG_EINTERNAL));
+    newCONSTSUB(stash, "AUG_EPATHX",    newSViv(AUG_EPATHX));
+    newCONSTSUB(stash, "AUG_ENOMATCH",  newSViv(AUG_ENOMATCH));
+    newCONSTSUB(stash, "AUG_EMMATCH",   newSViv(AUG_EMMATCH));
+    newCONSTSUB(stash, "AUG_ESYNTAX",   newSViv(AUG_ESYNTAX));
+
   }
 
 Config_Augeas*
@@ -177,6 +189,11 @@
 aug_save( aug );
       Config_Augeas *aug
 
+int 
+aug_load( aug );
+      Config_Augeas *aug
+
+
  # See example 9 in perlxstut man page
 int
 aug_print(aug, stream, path);
@@ -194,3 +211,22 @@
          }
     OUTPUT:
         RETVAL
+
+
+ # Error reporting
+
+int 
+aug_error( aug );
+      Config_Augeas *aug
+
+const char*
+aug_error_message(aug)
+      Config_Augeas* aug
+
+const char*
+aug_error_minor_message(aug)
+      Config_Augeas* aug
+
+const char*
+aug_error_details(aug)
+      Config_Augeas* aug

Modified: trunk/libconfig-augeas-perl/t/Config-Augeas.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libconfig-augeas-perl/t/Config-Augeas.t?rev=49146&op=diff
==============================================================================
--- trunk/libconfig-augeas-perl/t/Config-Augeas.t (original)
+++ trunk/libconfig-augeas-perl/t/Config-Augeas.t Tue Dec 22 03:44:51 2009
@@ -8,7 +8,7 @@
 
 use warnings ;
 use strict;
-use Test::More tests => 18 ;
+use Test::More tests => 23 ;
 
 ok(1,"Compilation done");
 
@@ -110,4 +110,17 @@
 @a =  $aug->defnode(local => $v,'127.0.0.2') ;
 is_deeply(\@a,[1,0],"defnode $v") ;
 
+my $ec= $aug->error ;
+is($ec, 'noerror', "no error found") ;
+my $emsg= $aug->error_minor_message ;
+is($emsg, undef, "no error message") ;
+
+$ret = $aug->get('/files/[blast]') ;
+$ec= $aug->error ;
+is($ec, 'pathx', "found path error") ;
+$emsg= $aug->error_minor_message ;
+ok($emsg, "error_minor_message: $emsg") ;
+$emsg= $aug->error_details ;
+ok($emsg, "error_details: $emsg") ;
+
 #$aug->print('') ;

Modified: trunk/libconfig-augeas-perl/t/Config-AugeasC.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libconfig-augeas-perl/t/Config-AugeasC.t?rev=49146&op=diff
==============================================================================
--- trunk/libconfig-augeas-perl/t/Config-AugeasC.t (original)
+++ trunk/libconfig-augeas-perl/t/Config-AugeasC.t Tue Dec 22 03:44:51 2009
@@ -23,7 +23,9 @@
 my $fail = 0;
 foreach my $constname (qw(AUG_NONE AUG_SAVE_BACKUP AUG_SAVE_NEWFILE 
 			  AUG_TYPE_CHECK AUG_NO_STDINC AUG_SAVE_NOOP
-			  AUG_NO_LOAD)) {
+			  AUG_NO_LOAD AUG_NO_MODL_AUTOLOAD AUG_NOERROR
+			  AUG_ENOMEM AUG_EINTERNAL AUG_EPATHX
+			  AUG_ENOMATCH AUG_EMMATCH AUG_ESYNTAX)) {
   next if (eval "my \$a = $constname; 1");
   if ($@ =~ /^Your vendor has not defined Config::Augeas macro $constname/) {
     print "# pass: $@";




More information about the Pkg-perl-cvs-commits mailing list