Use supermin4 binary when compiling libguestfs <= 1.24.
authorRichard W.M. Jones <rjones@redhat.com>
Sat, 8 Mar 2014 14:46:33 +0000 (14:46 +0000)
committerRichard W.M. Jones <rjones@redhat.com>
Sat, 8 Mar 2014 14:46:33 +0000 (14:46 +0000)
config.ml
libguestfs.ml
libguestfs_upstream.ml

index 6016647..aaf536c 100644 (file)
--- a/config.ml
+++ b/config.ml
@@ -36,10 +36,21 @@ let libguestfs_localconfigure source =
   \"$@\"
 " configure
 
-let libguestfs_localenv = "\
+let libguestfs_localenv supermin =
+  "\
 # Parallel test runs out of resources starting qemu, unclear why.
 export SKIP_TEST_PARALLEL_MOUNT_LOCAL=1
 
 # Fails under valgrind because cpio subprocess has a memory leak.
 export SKIP_TEST_FILE_ARCHITECTURE_11=1
-"
+
+" ^
+    match supermin with
+    | None -> ""
+    | Some (supermin, supermin_helper) ->
+      sprintf "\
+# Needs a modified path to supermin binaries:
+export SUPERMIN=%s
+export SUPERMIN_HELPER=%s
+
+" supermin supermin_helper
index f3759ac..2fe867a 100644 (file)
@@ -59,6 +59,14 @@ let vernames version =
         url = url }
   )
 
+(* For libguestfs <= 1.24, we need an old supermin 4 binary. *)
+let supermin = function
+  | { major = 1; minor = i } when i <= 24 ->
+    let home = Sys.getenv "HOME" in
+    Some ( home // "d/supermin4/src/supermin",
+           home // "d/supermin4/helper/supermin-helper" )
+  | _ -> None
+
 (* Clone or update a repo to the latest version on a branch, by force.
  * It is cached in name = $buildtmp/repos/<package>-<branch>
  *)
index 42f9897..06bf83b 100644 (file)
@@ -100,7 +100,7 @@ and website_built version =
   " buildtmp version.tarball
     version.package_version
     (quote (libguestfs_localconfigure `Tarball))
-    (quote libguestfs_localenv)
+    (quote (libguestfs_localenv (supermin version)))
     (quote libguestfs_website_repo)
 
 (* Goal: the tarball has passed the required set of tests before
@@ -127,7 +127,7 @@ and tarball_tested version =
   " buildtmp version.tarball
     version.package_version
     (quote (libguestfs_localconfigure `Tarball))
-    (quote libguestfs_localenv)
+    (quote (libguestfs_localenv (supermin version)))
 
 (* Goal: the tarball has been created from git. *)
 and tarball_created version =
@@ -160,7 +160,7 @@ and tarball_created version =
   " repodir
     version.version
     (quote (libguestfs_localconfigure `Git))
-    (quote libguestfs_localenv)
+    (quote (libguestfs_localenv (supermin version)))
     version.tarball buildtmp version.tarball
 
 (* Goal: test a commit. *)
@@ -194,7 +194,7 @@ and commit_tested branch commit =
   " repodir
     commit
     (quote (libguestfs_localconfigure `Git))
-    (quote libguestfs_localenv)
+    (quote (libguestfs_localenv None))
 
 and repo_up_to_date branch =
   git_force branch