It has been used unconditionally already for quite some time, so having
just the "realpath" command conditional on the presence of it does not
make much sense.

Drop the configure/build system handling of it, and make the "realpath"
command no more optional (but keeping the "realpath" feature,
unconditionally available now).
---
 configure.ac           |  1 -
 daemon/realpath.c      | 14 --------------
 generator/actions.ml   |  1 -
 generator/optgroups.ml |  1 +
 4 files changed, 1 insertion(+), 16 deletions(-)

diff --git a/configure.ac b/configure.ac
index 552ed77..f3fd10f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -308,7 +308,6 @@ AC_CHECK_FUNCS([\
     ntohs \
     posix_fallocate \
     posix_fadvise \
-    realpath \
     removexattr \
     setitimer \
     setxattr \
diff --git a/daemon/realpath.c b/daemon/realpath.c
index 99f5247..1e07291 100644
--- a/daemon/realpath.c
+++ b/daemon/realpath.c
@@ -33,14 +33,6 @@
 #include "optgroups.h"
 #include "actions.h"
 
-#ifdef HAVE_REALPATH
-
-int
-optgroup_realpath_available (void)
-{
-  return 1;
-}
-
 char *
 do_realpath (const char *path)
 {
@@ -57,12 +49,6 @@ do_realpath (const char *path)
   return ret;                  /* caller frees */
 }
 
-#else /* !HAVE_REALPATH */
-
-OPTGROUP_REALPATH_NOT_AVAILABLE
-
-#endif /* !HAVE_REALPATH */
-
 static int find_path_element (int fd_cwd, int is_end, const char *name, char 
**name_ret);
 
 char *
diff --git a/generator/actions.ml b/generator/actions.ml
index 0826137..85503ce 100644
--- a/generator/actions.ml
+++ b/generator/actions.ml
@@ -6665,7 +6665,6 @@ matching lines." };
     name = "realpath";
     style = RString "rpath", [Pathname "path"], [];
     proc_nr = Some 163;
-    optional = Some "realpath";
     tests = [
       InitISOFS, Always, TestResultString (
         [["realpath"; "/../directory"]], "/directory"), []
diff --git a/generator/optgroups.ml b/generator/optgroups.ml
index a08f9c3..eb5ff74 100644
--- a/generator/optgroups.ml
+++ b/generator/optgroups.ml
@@ -31,6 +31,7 @@ open Actions
  * but libguestfs ought to provide them to the user.
  *)
 let internal_optgroups_available = [
+  "realpath";
 ]
 
 (* Create list of optional groups. *)
-- 
1.9.0

_______________________________________________
Libguestfs mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/libguestfs

Reply via email to