mllib: Create config.ml from configure and use it for --version options.

Also don't internationalize the output of the --version option, as
that isn't useful.
This commit is contained in:
Richard W.M. Jones
2013-10-22 13:48:41 +01:00
parent d6e5a6546a
commit 5b89dd4aa1
13 changed files with 33 additions and 16 deletions

1
.gitignore vendored
View File

@@ -274,6 +274,7 @@ Makefile.in
/mllib/.depend
/mllib/common_gettext.ml
/mllib/common_utils_tests
/mllib/config.ml
/mllib/dummy
/mllib/libdir.ml
/ocaml/bindtests.bc

View File

@@ -83,6 +83,7 @@ OBJECTS = \
$(top_builddir)/mllib/fsync-c.o \
$(top_builddir)/mllib/fsync.cmx \
$(top_builddir)/mllib/password.cmx \
$(top_builddir)/mllib/config.cmx \
get_kernel.cmx \
downloader.cmx \
sigchecker.cmx \

View File

@@ -39,10 +39,7 @@ let default_cachedir =
let parse_cmdline () =
let display_version () =
let g = new G.guestfs () in
let version = g#version () in
printf (f_"virt-builder %Ld.%Ld.%Ld%s\n")
version.G.major version.G.minor version.G.release version.G.extra;
printf "virt-builder %s\n" Config.package_version;
exit 0
in

View File

@@ -1674,6 +1674,7 @@ AC_CONFIG_FILES([Makefile
lua/Makefile
lua/examples/Makefile
mllib/Makefile
mllib/config.ml
ocaml/META
ocaml/Makefile
ocaml/examples/Makefile

View File

@@ -27,6 +27,7 @@ SOURCES = \
common_gettext.ml \
common_utils.ml \
common_utils_tests.ml \
config.ml \
crypt-c.c \
crypt.ml \
crypt.mli \
@@ -65,6 +66,7 @@ OBJECTS = \
progress-c.o \
uri-c.o \
crypt-c.o \
config.cmx \
libdir.cmx \
common_gettext.cmx \
common_utils.cmx \

20
mllib/config.ml.in Normal file
View File

@@ -0,0 +1,20 @@
(* configuration for mllib.
* Copyright (C) 2013 Red Hat Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*)
let package_name = "@PACKAGE_NAME@"
let package_version = "@PACKAGE_VERSION@"

View File

@@ -9,6 +9,7 @@ builder/sigchecker.ml
mllib/common_gettext.ml
mllib/common_utils.ml
mllib/common_utils_tests.ml
mllib/config.ml
mllib/crypt.ml
mllib/firstboot.ml
mllib/fsync.ml

View File

@@ -44,6 +44,7 @@ OBJECTS = \
$(top_builddir)/mllib/uRI.cmx \
$(top_builddir)/mllib/common_gettext.cmx \
$(top_builddir)/mllib/common_utils.cmx \
$(top_builddir)/mllib/config.cmx \
resize.cmx
bin_SCRIPTS = virt-resize

View File

@@ -39,10 +39,7 @@ let infile, outfile, align_first, alignment, copy_boot_loader,
lv_expands, machine_readable, ntfsresize_force, output_format,
quiet, resizes, resizes_force, shrink, sparse =
let display_version () =
let g = new G.guestfs () in
let version = g#version () in
printf (f_"virt-resize %Ld.%Ld.%Ld%s\n")
version.G.major version.G.minor version.G.release version.G.extra;
printf "virt-resize %s\n" Config.package_version;
exit 0
in

View File

@@ -40,6 +40,7 @@ OBJECTS = \
$(top_builddir)/mllib/common_utils.cmx \
$(top_builddir)/mllib/tTY.cmx \
$(top_builddir)/mllib/progress.cmx \
$(top_builddir)/mllib/config.cmx \
statvfs-c.o \
sparsify.cmx

View File

@@ -39,10 +39,7 @@ let indisk, outdisk, check_tmpdir, compress, convert, debug_gc,
format, ignores, machine_readable,
option, quiet, verbose, trace, zeroes =
let display_version () =
let g = new G.guestfs () in
let version = g#version () in
printf "virt-sparsify %Ld.%Ld.%Ld%s\n"
version.G.major version.G.minor version.G.release version.G.extra;
printf "virt-sparsify %s\n" Config.package_version;
exit 0
in

View File

@@ -92,6 +92,7 @@ OBJECTS = \
$(top_builddir)/mllib/random_seed.cmx \
$(top_builddir)/mllib/hostname.cmx \
$(top_builddir)/mllib/firstboot.cmx \
$(top_builddir)/mllib/config.cmx \
sysprep_operation.cmx \
$(patsubst %,sysprep_operation_%.cmx,$(operations)) \
main.cmx

View File

@@ -46,10 +46,7 @@ let debug_gc, operations, g, selinux_relabel, quiet, mount_opts =
let mount_opts = ref "" in
let display_version () =
let g = new G.guestfs () in
let version = g#version () in
printf "virt-sysprep %Ld.%Ld.%Ld%s\n"
version.G.major version.G.minor version.G.release version.G.extra;
printf "virt-sysprep %s\n" Config.package_version;
exit 0
and add_file arg =
let uri =