summaryrefslogtreecommitdiffstats
path: root/daemon/tar.c
diff options
context:
space:
mode:
authorRichard Jones <rjones@redhat.com>2010-05-20 10:39:44 +0100
committerRichard Jones <rjones@redhat.com>2010-05-20 10:42:21 +0100
commit53ca11ee44f71ed056f72df9769ca93b9a35e1a7 (patch)
tree32f8e4508a7f9bef3d899379b5d27131bedde9ee /daemon/tar.c
parent30c091f49dafab4ca9c8b6640d19fc0450b15971 (diff)
downloadlibguestfs-53ca11ee44f71ed056f72df9769ca93b9a35e1a7.tar.gz
libguestfs-53ca11ee44f71ed056f72df9769ca93b9a35e1a7.tar.xz
libguestfs-53ca11ee44f71ed056f72df9769ca93b9a35e1a7.zip
generator: Make 'xz' into an optional group.
On Ubuntu <= Karmic, xz-utils was not packaged, and therefore any xz-related tests would fail. Thus make this an optional group so that we can test for this and avoid running the tests if xz utils are not present.
Diffstat (limited to 'daemon/tar.c')
-rw-r--r--daemon/tar.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/daemon/tar.c b/daemon/tar.c
index 941f80bd..ce3ca786 100644
--- a/daemon/tar.c
+++ b/daemon/tar.c
@@ -28,6 +28,14 @@
#include "../src/guestfs_protocol.h"
#include "daemon.h"
#include "actions.h"
+#include "optgroups.h"
+
+int
+optgroup_xz_available (void)
+{
+ int r = access ("/usr/bin/xz", X_OK);
+ return r == 0;
+}
/* Redirect errors from the tar command to the error file, then
* provide functions for reading it in. We overwrite the file each