r30796 - in /branches/upstream/libconfig-augeas-perl/current: Build.PL ChangeLog META.yml lib/Config/Augeas.pm lib/Config/Augeas.xs t/Config-AugeasC.t

ddumont-guest at users.alioth.debian.org ddumont-guest at users.alioth.debian.org
Wed Feb 18 11:56:51 UTC 2009


Author: ddumont-guest
Date: Wed Feb 18 11:56:47 2009
New Revision: 30796

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=30796
Log:
[svn-upgrade] Integrating new upstream version, libconfig-augeas-perl (0.400)

Modified:
    branches/upstream/libconfig-augeas-perl/current/Build.PL
    branches/upstream/libconfig-augeas-perl/current/ChangeLog
    branches/upstream/libconfig-augeas-perl/current/META.yml
    branches/upstream/libconfig-augeas-perl/current/lib/Config/Augeas.pm
    branches/upstream/libconfig-augeas-perl/current/lib/Config/Augeas.xs
    branches/upstream/libconfig-augeas-perl/current/t/Config-AugeasC.t

Modified: branches/upstream/libconfig-augeas-perl/current/Build.PL
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libconfig-augeas-perl/current/Build.PL?rev=30796&op=diff
==============================================================================
--- branches/upstream/libconfig-augeas-perl/current/Build.PL (original)
+++ branches/upstream/libconfig-augeas-perl/current/Build.PL Wed Feb 18 11:56:47 2009
@@ -22,7 +22,7 @@
 
 # snatched from ExtUtils::PkgConfig
 # don't go any further if pkg-config cannot be found.
-my $have_pkg_config = `pkg-config --version`;
+my $have_pkg_config = eval {`pkg-config --version`; };
 
 if ($have_pkg_config eq "") {
     # Warn and exit with status 0 to indicate (to the user and the CPAN
@@ -54,11 +54,11 @@
 my $aug_version = `pkg-config --modversion augeas` ;
 chomp($aug_cflags, $aug_libs, $aug_version) ;
 
-if (   not defined $aug_version or ( $aug_version lt '0.3.4')) {
+if (   not defined $aug_version or ( $aug_version lt '0.4.0')) {
     warn << "EOW2" ;
 ***
 *** 'pkg-config' did find augeas version $aug_version but 
-*** version 0.3.4 minimum is required
+*** version 0.4.0 minimum is required
 ***
 EOW2
     exit 0;

Modified: branches/upstream/libconfig-augeas-perl/current/ChangeLog
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libconfig-augeas-perl/current/ChangeLog?rev=30796&op=diff
==============================================================================
--- branches/upstream/libconfig-augeas-perl/current/ChangeLog (original)
+++ branches/upstream/libconfig-augeas-perl/current/ChangeLog Wed Feb 18 11:56:47 2009
@@ -1,3 +1,12 @@
+2009-02-17  Dominique Dumont  <dominique.dumont at hp.com> v0.400
+
+	* lib/Config/Augeas.xs (match): dies if aug_match returns -1. Perl
+	programmer can choose to trap this failure with eval or Error
+	module.
+
+	* lib/Config/Augeas.pm (match): cleanup trailing slashes in
+	path (required by new behavior of Augeas 0.4.0)
+
 2009-01-02  Domi  <domi at bilbo.maison> v0.305
 
 	* t/Config-AugeasC.t: Removed test involving AUGROOT environment

Modified: branches/upstream/libconfig-augeas-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libconfig-augeas-perl/current/META.yml?rev=30796&op=diff
==============================================================================
--- branches/upstream/libconfig-augeas-perl/current/META.yml (original)
+++ branches/upstream/libconfig-augeas-perl/current/META.yml Wed Feb 18 11:56:47 2009
@@ -1,6 +1,6 @@
 ---
 name: Config-Augeas
-version: 0.305
+version: 0.400
 author:
   - Dominique Dumont (ddumont at cpan dot org)
 abstract: Edit configuration files through Augeas C library
@@ -13,7 +13,7 @@
 provides:
   Config::Augeas:
     file: lib/Config/Augeas.pm
-    version: 0.305
+    version: 0.400
 generated_by: Module::Build version 0.3
 meta-spec:
   url: http://module-build.sourceforge.net/META-spec-v1.2.html

Modified: branches/upstream/libconfig-augeas-perl/current/lib/Config/Augeas.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libconfig-augeas-perl/current/lib/Config/Augeas.pm?rev=30796&op=diff
==============================================================================
--- branches/upstream/libconfig-augeas-perl/current/lib/Config/Augeas.pm (original)
+++ branches/upstream/libconfig-augeas-perl/current/lib/Config/Augeas.pm Wed Feb 18 11:56:47 2009
@@ -22,7 +22,7 @@
 use Carp;
 use IO::File ;
 
-our $VERSION = '0.305';
+our $VERSION = '0.400';
 
 require XSLoader;
 XSLoader::load('Config::Augeas', $VERSION);
@@ -170,6 +170,7 @@
 
     return 1 if $ret == 0;
 
+    $self -> print('/augeas') ;
     croak __PACKAGE__," set: error with path $path";
 }
 
@@ -207,6 +208,7 @@
 
     return 1 if $ret == 0;
 
+    $self->print('/augeas') ;
     croak __PACKAGE__," insert: error with path $path";
 }
 
@@ -271,7 +273,10 @@
     my $self = shift ;
     my $pattern = shift || croak __PACKAGE__," match: undefined pattern";
 
+    # Augeas 0.4.0 is a little picky about trailing slashes
+    $pattern =~ s!/$!!;
     return $self->{aug_c} -> match($pattern) ;
+
 }
 
 =head2 count_match ( pattern )
@@ -285,6 +290,8 @@
     my $self = shift ;
     my $pattern = shift || croak __PACKAGE__," count_match: undefined pattern";
 
+    # Augeas 0.4.0 is a little picky about trailing slashes
+    $pattern =~ s!/$!!;
     return $self->{aug_c} -> count_match($pattern) ;
 }
 

Modified: branches/upstream/libconfig-augeas-perl/current/lib/Config/Augeas.xs
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libconfig-augeas-perl/current/lib/Config/Augeas.xs?rev=30796&op=diff
==============================================================================
--- branches/upstream/libconfig-augeas-perl/current/lib/Config/Augeas.xs (original)
+++ branches/upstream/libconfig-augeas-perl/current/lib/Config/Augeas.xs Wed Feb 18 11:56:47 2009
@@ -22,6 +22,8 @@
 #define NEED_newCONSTSUB
 #include "ppport.h"
 
+#include <string.h>
+#include <stdio.h>
 #include <augeas.h>
 
 typedef augeas   Config_Augeas ;
@@ -102,15 +104,28 @@
       Config_Augeas *aug
       const char *pattern
     PREINIT:
-        char**  matches;
+        char** matches;
+        char** err_matches;
+        const char*  err_string ;
         int i ;
+        int ret ;
 	int cnt;
+	char die_msg[1024] ;
+	char tmp_msg[128];
     PPCODE:
     
         cnt = aug_match(aug, pattern, &matches);
 
         if (cnt == -1) {
-            return ;
+	   sprintf(die_msg, "aug_match error with pattern '%s':\n",pattern);
+    	   cnt = aug_match(aug,"/augeas//error/descendant-or-self::*",&err_matches);
+	   for (i=0; i < cnt; i++) {
+               ret = aug_get(aug, err_matches[i], &err_string) ;
+	       sprintf(tmp_msg,"%s = %s\n", err_matches[i], err_string );
+	       if (strlen(die_msg) + strlen(tmp_msg) < 1024 )
+	       	       strcat(die_msg,tmp_msg);
+	   }
+	   croak (die_msg);
         }
 
         // printf("match: Pattern %s matches %d times\n", pattern, cnt);

Modified: branches/upstream/libconfig-augeas-perl/current/t/Config-AugeasC.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libconfig-augeas-perl/current/t/Config-AugeasC.t?rev=30796&op=diff
==============================================================================
--- branches/upstream/libconfig-augeas-perl/current/t/Config-AugeasC.t (original)
+++ branches/upstream/libconfig-augeas-perl/current/t/Config-AugeasC.t Wed Feb 18 11:56:47 2009
@@ -137,10 +137,10 @@
 # get return value directly from Augeas
 is($ret ,0,"mv ok");
 
-my @a = $augc->match("/files/etc/hosts/") ;
+my @a = $augc->match("/files/etc/hosts") ;
 is_deeply(\@a,["/files/etc/hosts"],"match result") ;
 
-$ret = $augc->count_match("/files/etc/hosts/") ;
+$ret = $augc->count_match("/files/etc/hosts") ;
 is($ret,1,"count_match result") ;
 
 $ret = $augc->save ;




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