diff --git a/README b/README index 2ec8e28a2..8f23b088c 100644 --- a/README +++ b/README @@ -100,6 +100,8 @@ The full requirements are described below. +--------------+-------------+---+-----------------------------------------+ | libxml2 | | R | Popular XML library. | +--------------+-------------+---+-----------------------------------------+ +| augeas | 1.0.0 | R | | ++--------------+-------------+---+-----------------------------------------+ | po4a | |R/O| Required if compiling from git. | | | | | Optional if compiling from tarball. | | | | | For localizing man pages. | @@ -120,8 +122,6 @@ The full requirements are described below. | libselinux | | O | Used by the libvirt backend to securely | | | | | confine the appliance (sVirt). | +--------------+-------------+---+-----------------------------------------+ -| augeas | 0.5.0 | O | To inspect configuration of Linux guests. -+--------------+-------------+---+-----------------------------------------+ | db utils | | O | db_dump, db_load etc. Usually found in | | | | | a package called db-utils, db4-utils, | | | | | db4.X-utils, Berkeley DB utils, etc. | diff --git a/configure.ac b/configure.ac index db7d37b37..2bfc4bf75 100644 --- a/configure.ac +++ b/configure.ac @@ -550,19 +550,6 @@ AM_CONDITIONAL([HAVE_XDR_U_INT64_T], AM_CONDITIONAL([HAVE_XDR_UINT64_T], [test "x$ac_cv_search_xdr_uint64_t" != "xno"]) -dnl Check for Augeas (optional). -PKG_CHECK_MODULES([AUGEAS],[augeas],[ - AC_SUBST([AUGEAS_CFLAGS]) - AC_SUBST([AUGEAS_LIBS]) - AC_DEFINE([HAVE_AUGEAS],[1],[Define to 1 if you have Augeas.]) - - old_LIBS="$LIBS" - LIBS="$LIBS $AUGEAS_LIBS" - dnl Check for functions not available in earlier versions of Augeas. - AC_CHECK_FUNCS([aug_load aug_defvar aug_defnode]) - LIBS="$old_LIBS" -],[AC_MSG_WARN([augeas not found, some core features will be disabled])]) - dnl Check for libselinux (optional). AC_CHECK_HEADERS([selinux/selinux.h]) AC_CHECK_LIB([selinux],[setexeccon],[ @@ -816,6 +803,9 @@ AS_IF([test "x$with_readline" != xno],[ dnl Check for PCRE (required) PKG_CHECK_MODULES([PCRE], [libpcre]) +dnl Check for Augeas >= 1.0.0 (required). +PKG_CHECK_MODULES([AUGEAS],[augeas >= 1.0.0]) + dnl libmagic (highly recommended) AC_CHECK_LIB([magic],[magic_file],[ AC_CHECK_HEADER([magic.h],[ diff --git a/daemon/augeas.c b/daemon/augeas.c index c0c97e303..4525c47a7 100644 --- a/daemon/augeas.c +++ b/daemon/augeas.c @@ -23,15 +23,18 @@ #include #include -#ifdef HAVE_AUGEAS #include -#endif #include "daemon.h" #include "actions.h" #include "optgroups.h" -#ifdef HAVE_AUGEAS +int +optgroup_augeas_available (void) +{ + return 1; +} + /* The Augeas handle. We maintain a single handle per daemon, which * is all that is necessary and reduces the complexity of the API * considerably. @@ -58,12 +61,6 @@ aug_finalize (void) } \ while (0) -int -optgroup_augeas_available (void) -{ - return 1; -} - /* We need to rewrite the root path so it is based at /sysroot. */ int do_aug_init (const char *root, int flags) @@ -105,7 +102,6 @@ do_aug_close (void) int do_aug_defvar (const char *name, const char *expr) { -#ifdef HAVE_AUG_DEFVAR int r; NEED_AUG (-1); @@ -116,16 +112,11 @@ do_aug_defvar (const char *name, const char *expr) return -1; } return r; -#else - reply_with_error ("function not available"); - return -1; -#endif } guestfs_int_int_bool * do_aug_defnode (const char *name, const char *expr, const char *val) { -#ifdef HAVE_AUG_DEFNODE guestfs_int_int_bool *r; int i, created; @@ -147,10 +138,6 @@ do_aug_defnode (const char *name, const char *expr, const char *val) r->b = created; return r; -#else - reply_with_error ("function not available"); - return NULL; -#endif } char * @@ -317,7 +304,6 @@ do_aug_save (void) int do_aug_load (void) { -#ifdef HAVE_AUG_LOAD NEED_AUG (-1); if (aug_load (aug) == -1) { @@ -326,10 +312,6 @@ do_aug_load (void) } return 0; -#else - reply_with_error ("function not available"); - return -1; -#endif } /* Simpler version of aug-match, which also sorts the output. */ @@ -375,9 +357,3 @@ do_aug_ls (const char *path) sort_strings (matches, count_strings ((void *) matches)); return matches; /* Caller frees. */ } - -#else /* !HAVE_AUGEAS */ - -OPTGROUP_AUGEAS_NOT_AVAILABLE - -#endif diff --git a/src/inspect-fs-unix.c b/src/inspect-fs-unix.c index 9c0b31038..a23aee683 100644 --- a/src/inspect-fs-unix.c +++ b/src/inspect-fs-unix.c @@ -1525,10 +1525,6 @@ inspect_with_augeas (guestfs_h *g, struct inspect_fs *fs, } } - /* If !feature_available (g, "augeas") then the next call will fail. - * Arguably we might want to fall back to a non-Augeas method in - * this case. - */ if (guestfs_aug_init (g, "/", 16|32) == -1) return -1;