summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Jones <rjones@redhat.com>2010-08-27 13:38:49 +0100
committerRichard Jones <rjones@redhat.com>2010-08-27 22:10:30 +0100
commitd88defecffa56887b0caa83629b2bb370fc149ed (patch)
tree69de0f6b1f049fa16836e76163e8b47a43a0dad7
parent20273a9ee6a245ac6f9137531f8428af98ddcbc0 (diff)
downloadlibguestfs-d88defecffa56887b0caa83629b2bb370fc149ed.tar.gz
libguestfs-d88defecffa56887b0caa83629b2bb370fc149ed.tar.xz
libguestfs-d88defecffa56887b0caa83629b2bb370fc149ed.zip
build: Don't add version extra string to the version number.
If this string was non-empty, then it broke a lot of things because autoconf and other parts of the build system were expecting this string to contain a simple MAJOR.MINOR.RELEASE version number. This requires changes to guestfish and guestmount so they use the guestfs_version API to fetch the version from the library. (The Perl tools were already doing it this way). In a way this is more accurate, because it's no longer hard-coded in the binary, but fetched from the dynamically linked libguestfs.so. (cherry picked from commit 4932fdca3ca1e9002164a1c0b73876f32739d34d)
-rw-r--r--configure.ac2
-rw-r--r--fish/fish.c8
-rw-r--r--fuse/guestmount.c8
3 files changed, 13 insertions, 5 deletions
diff --git a/configure.ac b/configure.ac
index 7daa2ac9..64548969 100644
--- a/configure.ac
+++ b/configure.ac
@@ -22,7 +22,7 @@ m4_define([libguestfs_release], [3])
# extra can be any string
m4_define([libguestfs_extra], [])
-AC_INIT([libguestfs],libguestfs_major.libguestfs_minor.libguestfs_release[]libguestfs_extra)
+AC_INIT([libguestfs],libguestfs_major.libguestfs_minor.libguestfs_release)
AC_CONFIG_AUX_DIR([build-aux])
AM_INIT_AUTOMAKE([foreign])
diff --git a/fish/fish.c b/fish/fish.c
index 4276ae19..d2106ebd 100644
--- a/fish/fish.c
+++ b/fish/fish.c
@@ -20,6 +20,7 @@
#include <stdio.h>
#include <stdlib.h>
+#include <inttypes.h>
#include <string.h>
#include <unistd.h>
#include <fcntl.h>
@@ -351,9 +352,12 @@ main (int argc, char *argv[])
guestfs_set_verbose (g, verbose);
break;
- case 'V':
- printf ("%s %s\n", program_name, PACKAGE_VERSION);
+ case 'V': {
+ struct guestfs_version *v = guestfs_version (g);
+ printf ("%s %"PRIi64".%"PRIi64".%"PRIi64"%s\n", program_name,
+ v->major, v->minor, v->release, v->extra);
exit (EXIT_SUCCESS);
+ }
case 'x':
guestfs_set_trace (g, 1);
diff --git a/fuse/guestmount.c b/fuse/guestmount.c
index e1cb2d89..9b7e520a 100644
--- a/fuse/guestmount.c
+++ b/fuse/guestmount.c
@@ -29,6 +29,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
+#include <inttypes.h>
#include <string.h>
#include <unistd.h>
#include <getopt.h>
@@ -1074,9 +1075,12 @@ main (int argc, char *argv[])
guestfs_set_verbose (g, verbose);
break;
- case 'V':
- printf ("%s %s\n", program_name, PACKAGE_VERSION);
+ case 'V': {
+ struct guestfs_version *v = guestfs_version (g);
+ printf ("%s %"PRIi64".%"PRIi64".%"PRIi64"%s\n", program_name,
+ v->major, v->minor, v->release, v->extra);
exit (EXIT_SUCCESS);
+ }
case HELP_OPTION:
usage (EXIT_SUCCESS);