On Thu, 2009-08-06 at 16:27 +0200, Kristof Willaert wrote:
> > And I assume 'print /augeas//error' still doesn't produce anything ? can
> > you run 'augtool print > /tmp/augeas.txt' and send that ?
> 
> Indeed, print /augeas//error doesn't produce anything.
> 
> I ran augtool print (with a minimal set of lenses) and it produced:

It finds the lenses, but then fails to find the files or fails loading
files w/o reporting anything.

Attached is a patch (apply with 'patch -p1 < this.patch' in the toplevel
dir) that prints some more info - maybe that will shed some light on
what is happening.

David

>From 622ba83a82dee0c8d4bcd6f4fd44868a2cc66f73 Mon Sep 17 00:00:00 2001
From: David Lutterkort <[email protected]>
Date: Thu, 6 Aug 2009 17:30:00 -0700
Subject: [PATCH] Some debug printing for the AIX issue

---
 src/transform.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/src/transform.c b/src/transform.c
index fe4a511..6de62c0 100644
--- a/src/transform.c
+++ b/src/transform.c
@@ -114,12 +114,15 @@ static int filter_generate(struct tree *xfm, const char *root,
     *matches = NULL;
     MEMZERO(&globbuf, 1);
 
+    fprintf(stderr, "FILTER: %s\n", xfm->label);
     list_for_each(f, xfm->children) {
         char *globpat = NULL;
         if (! is_incl(f))
             continue;
         pathjoin(&globpat, 2, root, f->value);
         r = glob(globpat, gl_flags, NULL, &globbuf);
+        fprintf(stderr, "  glob(%s, pathc=%d) = %d\n", globpat,
+                (int) globbuf.gl_pathc, r);
         free(globpat);
 
         if (r != 0 && r != GLOB_NOMATCH) {
@@ -157,6 +160,7 @@ static int filter_generate(struct tree *xfm, const char *root,
         pathc = 0;
         ret = -1;
     }
+    fprintf(stderr, "  %d matches\n", pathc);
     *matches = pathv;
     *nmatches = pathc;
  done:
@@ -296,10 +300,14 @@ static int store_error(struct augeas *aug,
                 }
             }
             err_set(aug, &ep, s_message, "%s", err->message);
+            fprintf(stderr, "  error: %s\n", err->message);
         } else if (errnum != 0) {
             const char *msg = strerror(errnum);
             err_set(aug, &ep, s_message, "%s", msg);
+            fprintf(stderr, "  error[%d]: %s\n", errnum, msg);
         }
+    } else {
+        fprintf(stderr, "  success\n");
     }
 
     result = 0;
@@ -383,6 +391,8 @@ static int load_file(struct augeas *aug, struct lens *lens, char *filename) {
     struct lns_error *err = NULL;
     int result = -1, r;
 
+    fprintf(stderr, "LOAD_FILE: %s\n", filename);
+
     pathjoin(&path, 2, AUGEAS_FILES_TREE, filename + strlen(aug->root) - 1);
 
     r = add_load_info(aug, filename, path, lens);
-- 
1.6.0.6

_______________________________________________
augeas-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/augeas-devel

Reply via email to