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

e76f14
From 689121835dc22f576fa0182c6f0e94a27a24ba6a 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
e76f14
index d8fb15b..56dffa6 100644
0d20ef
--- a/appliance/Makefile.am
0d20ef
+++ b/appliance/Makefile.am
e76f14
@@ -77,8 +77,6 @@ supermin.d/daemon.tar.gz: ../daemon/guestfsd guestfs_lvm_conf.aug guestfs_shadow
e76f14
 	rm -rf tmp-d
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)/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
e76f14
index 14cc0cf..fc13143 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
e76f14
index aa8fd59..83150d1 100644
0d20ef
--- a/daemon/lvm-filter.c
0d20ef
+++ b/daemon/lvm-filter.c
e76f14
@@ -122,7 +122,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;
e76f14
@@ -133,7 +133,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
-- 
7af31e
1.8.3.1
0d20ef