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

e9bfca
From d7174bcc5290e4ef4996541bed93f0df7e680578 Mon Sep 17 00:00:00 2001
151578
From: Pino Toscano <ptoscano@redhat.com>
151578
Date: Fri, 24 Oct 2014 16:33:50 +0100
151578
Subject: [PATCH] RHEL 7: Disable alternate Augeas lenses.
151578
151578
These are included in the RHEL 7.1 augeas package, and therefore
151578
not required in RHEL.
151578
151578
See:
151578
https://www.redhat.com/archives/libguestfs/2014-October/msg00220.html
151578
---
151578
 appliance/Makefile.am | 1 -
151578
 daemon/augeas.c       | 5 ++++-
151578
 2 files changed, 4 insertions(+), 2 deletions(-)
151578
151578
diff --git a/appliance/Makefile.am b/appliance/Makefile.am
e9bfca
index 6cba8d158..16714b197 100644
151578
--- a/appliance/Makefile.am
151578
+++ b/appliance/Makefile.am
151578
@@ -91,7 +91,6 @@ supermin.d/daemon.tar.gz: ../daemon/guestfsd guestfs_shadow.aug
151578
 	rm -rf tmp-d
151578
 	mkdir -p tmp-d$(DAEMON_SUPERMIN_DIR) tmp-d/etc tmp-d/usr/share/guestfs
151578
 	ln ../daemon/guestfsd tmp-d$(DAEMON_SUPERMIN_DIR)/guestfsd
151578
-	ln $(srcdir)/guestfs_shadow.aug tmp-d/usr/share/guestfs/guestfs_shadow.aug
151578
 	( cd tmp-d && tar zcf - * ) > $@-t
151578
 	rm -r tmp-d
151578
 	mv $@-t $@
151578
diff --git a/daemon/augeas.c b/daemon/augeas.c
e9bfca
index 453251337..003fcd313 100644
151578
--- a/daemon/augeas.c
151578
+++ b/daemon/augeas.c
151578
@@ -134,7 +134,7 @@ do_aug_init (const char *root, int flags)
151578
   }
151578
 
151578
   /* Pass AUG_NO_ERR_CLOSE so we can display detailed errors. */
151578
-  aug = aug_init (buf, "/usr/share/guestfs/", flags | AUG_NO_ERR_CLOSE);
151578
+  aug = aug_init (buf, NULL, flags | AUG_NO_ERR_CLOSE);
151578
 
151578
   if (!aug) {
151578
     reply_with_error ("augeas initialization failed");
151578
@@ -148,6 +148,8 @@ do_aug_init (const char *root, int flags)
151578
     return -1;
151578
   }
151578
 
151578
+  /* We already have the needed lenses in RHEL 7 */
151578
+#if 0
151578
   if (!augeas_is_version (1, 2, 1)) {
151578
     int r = aug_transform (aug, "guestfs_shadow", "/etc/shadow",
151578
                            0 /* = included */);
151578
@@ -166,6 +168,7 @@ do_aug_init (const char *root, int flags)
151578
       }
151578
     }
151578
   }
151578
+#endif
151578
 
151578
   return 0;
151578
 }
151578
-- 
8ff76f
2.20.1
151578