mrc0mmand / rpms / libguestfs

Forked from rpms/libguestfs 3 years ago
Clone

Blame SOURCES/0109-RHEL-7-Disable-alternate-Augeas-lenses.patch

ffd6ed
From 1156f17878c25ba3221105b339ab9ff298bd123d Mon Sep 17 00:00:00 2001
0d20ef
From: Pino Toscano <ptoscano@redhat.com>
0d20ef
Date: Fri, 24 Oct 2014 16:33:50 +0100
0d20ef
Subject: [PATCH] RHEL 7: Disable alternate Augeas lenses.
0d20ef
0d20ef
These are included in the RHEL 7.1 augeas package, and therefore
0d20ef
not required in RHEL.
0d20ef
0d20ef
See:
0d20ef
https://www.redhat.com/archives/libguestfs/2014-October/msg00220.html
0d20ef
---
0d20ef
 appliance/Makefile.am | 2 --
0d20ef
 daemon/augeas.c       | 5 ++++-
0d20ef
 daemon/lvm-filter.c   | 4 ++--
0d20ef
 3 files changed, 6 insertions(+), 5 deletions(-)
0d20ef
0d20ef
diff --git a/appliance/Makefile.am b/appliance/Makefile.am
0d20ef
index 7b30bbe..c7eca20 100644
0d20ef
--- a/appliance/Makefile.am
0d20ef
+++ b/appliance/Makefile.am
0d20ef
@@ -82,8 +82,6 @@ supermin.d/daemon.tar.gz: ../daemon/guestfsd guestfsd.suppressions guestfs_lvm_c
0d20ef
 	mkdir -p tmp-d$(DAEMON_SUPERMIN_DIR) tmp-d/etc tmp-d/usr/share/guestfs
0d20ef
 	ln ../daemon/guestfsd tmp-d$(DAEMON_SUPERMIN_DIR)/guestfsd
0d20ef
 	ln $(srcdir)/guestfsd.suppressions tmp-d/etc/guestfsd.suppressions
0d20ef
-	ln $(srcdir)/guestfs_lvm_conf.aug tmp-d/usr/share/guestfs/guestfs_lvm_conf.aug
0d20ef
-	ln $(srcdir)/guestfs_shadow.aug tmp-d/usr/share/guestfs/guestfs_shadow.aug
0d20ef
 	( cd tmp-d && tar zcf - * ) > $@-t
0d20ef
 	rm -r tmp-d
0d20ef
 	mv $@-t $@
0d20ef
diff --git a/daemon/augeas.c b/daemon/augeas.c
0d20ef
index ce49726..7753e67 100644
0d20ef
--- a/daemon/augeas.c
0d20ef
+++ b/daemon/augeas.c
0d20ef
@@ -134,7 +134,7 @@ do_aug_init (const char *root, int flags)
0d20ef
   }
0d20ef
 
0d20ef
   /* Pass AUG_NO_ERR_CLOSE so we can display detailed errors. */
0d20ef
-  aug = aug_init (buf, "/usr/share/guestfs/", flags | AUG_NO_ERR_CLOSE);
0d20ef
+  aug = aug_init (buf, NULL, flags | AUG_NO_ERR_CLOSE);
0d20ef
 
0d20ef
   if (!aug) {
0d20ef
     reply_with_error ("augeas initialization failed");
0d20ef
@@ -148,6 +148,8 @@ do_aug_init (const char *root, int flags)
0d20ef
     return -1;
0d20ef
   }
0d20ef
 
0d20ef
+  /* We already have the needed lenses in RHEL 7 */
0d20ef
+#if 0
0d20ef
   if (!augeas_is_version (1, 2, 1)) {
0d20ef
     int r = aug_transform (aug, "guestfs_shadow", "/etc/shadow",
0d20ef
                            0 /* = included */);
0d20ef
@@ -166,6 +168,7 @@ do_aug_init (const char *root, int flags)
0d20ef
       }
0d20ef
     }
0d20ef
   }
0d20ef
+#endif
0d20ef
 
0d20ef
   return 0;
0d20ef
 }
0d20ef
diff --git a/daemon/lvm-filter.c b/daemon/lvm-filter.c
0d20ef
index d82fde0..9e0f570 100644
0d20ef
--- a/daemon/lvm-filter.c
0d20ef
+++ b/daemon/lvm-filter.c
0d20ef
@@ -121,7 +121,7 @@ set_filter (char *const *filters)
0d20ef
    * but do that only after having applied the transformation.
0d20ef
    */
0d20ef
   const int flags = AUG_NO_ERR_CLOSE | AUG_NO_LOAD;
0d20ef
-  aug = aug_init (lvm_system_dir, "/usr/share/guestfs/", flags);
0d20ef
+  aug = aug_init (lvm_system_dir, NULL, flags);
0d20ef
   if (!aug) {
0d20ef
     reply_with_error ("augeas initialization failed");
0d20ef
     return -1;
0d20ef
@@ -132,7 +132,7 @@ set_filter (char *const *filters)
0d20ef
     return -1;
0d20ef
   }
0d20ef
 
0d20ef
-  r = aug_transform (aug, "guestfs_lvm_conf", "/lvm/lvm.conf",
0d20ef
+  r = aug_transform (aug, "lvm", "/lvm/lvm.conf",
0d20ef
                      0 /* = included */);
0d20ef
   if (r == -1) {
0d20ef
     AUGEAS_ERROR ("aug_transform");
0d20ef
-- 
0d20ef
1.8.3.1
0d20ef