[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[augeas-devel] augeas: master - * src/augeas.c (aug_init): make it easier to override distributed lenses



Gitweb:        http://git.fedorahosted.org/git/augeas.git?p=augeas.git;a=commitdiff;h=62dbd8c7bd0511b32fe26317731aaa8a5c8b2fb7
Commit:        62dbd8c7bd0511b32fe26317731aaa8a5c8b2fb7
Parent:        f7c35b0333ad3401395e9cd6254d059c4ec1dffe
Author:        David Lutterkort <lutter redhat com>
AuthorDate:    Tue Mar 24 16:41:11 2009 -0700
Committer:     David Lutterkort <lutter redhat com>
CommitterDate: Tue Mar 24 16:41:11 2009 -0700

* src/augeas.c (aug_init): make it easier to override distributed lenses

Make the default load path

   $(datadir)/augeas/lenses:$(datadir)/augeas/lenses/dist

and instal the lenses we distribute into the dist/ subdir. That makes it
easy for other packages to override lenses we ship: when they are installed
into $(datadir)/augeas/lenses, they are automatically preferred over the
ones we ship.
---
 Makefile.am    |    4 ++--
 src/augeas.c   |    1 +
 src/internal.h |    3 +++
 3 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 33e7d94..5a531f0 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -2,8 +2,8 @@ SUBDIRS=gnulib/lib src gnulib/tests tests man doc examples
 
 ACLOCAL_AMFLAGS = -I gnulib/m4
 
-lensdir=$(datadir)/augeas/lenses
-lenstestdir=$(datadir)/augeas/lenses/tests
+lensdir=$(datadir)/augeas/lenses/dist
+lenstestdir=$(datadir)/augeas/lenses/dist/tests
 
 dist_lens_DATA=$(wildcard lenses/*.aug)
 dist_lenstest_DATA=$(wildcard lenses/tests/*.aug)
diff --git a/src/augeas.c b/src/augeas.c
index f239bfa..3b654f1 100644
--- a/src/augeas.c
+++ b/src/augeas.c
@@ -252,6 +252,7 @@ struct augeas *aug_init(const char *root, const char *loadpath,
     }
     if (!(flags & AUG_NO_STDINC)) {
         argz_add(&result->modpathz, &result->nmodpath, AUGEAS_LENS_DIR);
+        argz_add(&result->modpathz, &result->nmodpath, AUGEAS_LENS_DIST_DIR);
     }
     /* Clean up trailing slashes */
     if (result->nmodpath > 0) {
diff --git a/src/internal.h b/src/internal.h
index 060c95f..a2698b4 100644
--- a/src/internal.h
+++ b/src/internal.h
@@ -43,6 +43,9 @@
  * The default location for lens definitions */
 #define AUGEAS_LENS_DIR DATADIR "/augeas/lenses"
 
+/* The directory where we install lenses distribute with Augeas */
+#define AUGEAS_LENS_DIST_DIR DATADIR "/augeas/lenses/dist"
+
 /* Define: AUGEAS_ROOT_ENV
  * The env var that points to the chroot holding files we may modify.
  * Mostly useful for testing */



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]