[augeas-devel] [PATCH] Put the default dir for lenses into DATADIR

David Lutterkort dlutter at redhat.com
Mon Jun 30 23:15:58 UTC 2008


2 files changed, 7 insertions(+), 3 deletions(-)
configure.ac   |    7 +++++++
src/internal.h |    3 ---


# HG changeset patch
# User David Lutterkort <dlutter at redhat.com>
# Date 1214867736 25200
# Node ID 14602e2757ddfe11e2b445edddac8be519af771b
# Parent  e54775f752efbd87d2f3693da2ab788ee3026b51
Put the default dir for lenses into DATADIR

Instead of hardcoding the default dir for lenses to somewhere in '/usr',
look in DATADIR - that's after all where the default lenses are installed
if DATADIR (or PREFIX) is changed.

diff -r e54775f752ef -r 14602e2757dd configure.ac
--- a/configure.ac	Mon Jun 30 15:23:24 2008 -0700
+++ b/configure.ac	Mon Jun 30 16:15:36 2008 -0700
@@ -32,6 +32,13 @@
 
 gl_INIT
 
+dnl This is a pretty hackish way to expand all the variable references
+dnl in DATADIR. In the end, we want a full absolute path
+eval aug_lens_dir=$datadir/augeas/lenses
+eval aug_lens_dir=$aug_lens_dir
+AC_DEFINE_UNQUOTED([AUGEAS_LENS_DIR], "$aug_lens_dir",
+                   "The default location for lens definitions")
+
 AC_OUTPUT(Makefile \
           gnulib/lib/Makefile \
           gnulib/tests/Makefile \
diff -r e54775f752ef -r 14602e2757dd src/internal.h
--- a/src/internal.h	Mon Jun 30 15:23:24 2008 -0700
+++ b/src/internal.h	Mon Jun 30 16:15:36 2008 -0700
@@ -59,9 +59,6 @@
 
 /* How we save files. One of 'backup', 'overwrite' or 'newfile' */
 #define AUGEAS_META_SAVE_MODE AUGEAS_META_TREE "/save"
-
-/* Where the default spec files live. */
-#define AUGEAS_LENS_DIR "/usr/share/augeas/lenses"
 
 /* Name of env var that contains list of paths to search for additional
    spec files */




More information about the augeas-devel mailing list