After the proposed split of the libguestfs repo, we will end up with
the following layout:
libguestfs.git
common -> git submodule libguestfs-common.git
generator
virt-v2v.git
common -> git submodule libguestfs-common.git
guestfs-tools.git
common -> git submodule libguestfs-common.git
The generator will only be able to write to libguestfs directories and
the common directory/submodule. This is mostly the case already with
only 6 exceptions:
customize/customize-options.pod
customize/customize-synopsis.pod
customize/customize_cmdline.ml
customize/customize_cmdline.mli
v2v/uefi.ml
v2v/uefi.mli
This commit moves these files around so they appear under common/ml*
It is somewhat unsatisfactory because it involves copying files
around, but there are some mitigating factors:
(1) Any changes now give us more freedom to develop faster and thus
clean things up in future.
(2) The v2v/uefi files ought to go away in future anyway.
This is simple code motion and should have no effect on the built
programs or tests.
---
.gitignore | 8 ++++++--
Makefile.am | 1 +
builder/Makefile.am | 6 +++---
builder/test-docs.sh | 4 ++--
common/mlcustomize/Makefile.am | 12 ++++++++++++
common/mlv2v/Makefile.am | 28 +++++++++++++++++++++++++++
configure.ac | 1 +
customize/Makefile.am | 24 +++++++++++++----------
customize/test-virt-customize-docs.sh | 4 ++--
docs/guestfs-hacking.pod | 4 ++++
generator/main.ml | 12 ++++++------
po-docs/podfiles | 4 ++--
v2v/Makefile.am | 16 +++++++++------
13 files changed, 91 insertions(+), 33 deletions(-)
diff --git a/.gitignore b/.gitignore
index 657ebdb8c..2ea4bfbe6 100644
--- a/.gitignore
+++ b/.gitignore
@@ -128,6 +128,10 @@ Makefile.in
/common/errnostring/errnostring.h
/common/mlaugeas/.depend
/common/mlcustomize/.depend
+/common/mlcustomize/customize_cmdline.ml
+/common/mlcustomize/customize_cmdline.mli
+/common/mlcustomize/customize-options.pod
+/common/mlcustomize/customize-synopsis.pod
/common/mlcustomize/test-firstboot-*.sh
/common/mlgettext/.depend
/common/mlgettext/common_gettext.ml
@@ -153,6 +157,8 @@ Makefile.in
/common/mlutils/.depend
/common/mlutils/c_utils_unit_tests
/common/mlutils/oUnit-*
+/common/mlv2v/uefi.ml
+/common/mlv2v/uefi.mli
/common/mlvisit/.depend
/common/mlvisit/visit_tests
/common/mlxml/.depend
@@ -177,8 +183,6 @@ Makefile.in
/customize/.depend
/customize/customize_cmdline.ml
/customize/customize_cmdline.mli
-/customize/customize-options.pod
-/customize/customize-synopsis.pod
/customize/stamp-virt-customize.pod
/customize/test-password-*.sh
/customize/test-settings-*.sh
diff --git a/Makefile.am b/Makefile.am
index b5d5dcd6b..9ce0a75a7 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -164,6 +164,7 @@ SUBDIRS += common/mlvisit
SUBDIRS += common/mlxml
SUBDIRS += common/mltools
SUBDIRS += common/mlcustomize
+SUBDIRS += common/mlv2v
if HAVE_LIBVIRT
SUBDIRS += common/mllibvirt
endif
diff --git a/builder/Makefile.am b/builder/Makefile.am
index 7b4c3a59e..daf4778c7 100644
--- a/builder/Makefile.am
+++ b/builder/Makefile.am
@@ -263,12 +263,12 @@ noinst_DATA += $(top_builddir)/website/virt-builder.1.html
virt-builder.1 $(top_builddir)/website/virt-builder.1.html: stamp-virt-builder.pod
-stamp-virt-builder.pod: virt-builder.pod $(top_srcdir)/customize/customize-synopsis.pod
$(top_srcdir)/customize/customize-options.pod
+stamp-virt-builder.pod: virt-builder.pod
$(top_srcdir)/common/mlcustomize/customize-synopsis.pod
$(top_srcdir)/common/mlcustomize/customize-options.pod
$(PODWRAPPER) \
--man virt-builder.1 \
--html $(top_builddir)/website/virt-builder.1.html \
- --insert $(top_srcdir)/customize/customize-synopsis.pod:__CUSTOMIZE_SYNOPSIS__ \
- --insert $(top_srcdir)/customize/customize-options.pod:__CUSTOMIZE_OPTIONS__ \
+ --insert
$(top_srcdir)/common/mlcustomize/customize-synopsis.pod:__CUSTOMIZE_SYNOPSIS__ \
+ --insert $(top_srcdir)/common/mlcustomize/customize-options.pod:__CUSTOMIZE_OPTIONS__
\
--license GPLv2+ \
--warning safe \
$<
diff --git a/builder/test-docs.sh b/builder/test-docs.sh
index 6f39b906d..7cac4fe2d 100755
--- a/builder/test-docs.sh
+++ b/builder/test-docs.sh
@@ -22,8 +22,8 @@ $TEST_FUNCTIONS
skip_if_skipped
$top_srcdir/podcheck.pl virt-builder.pod virt-builder \
- --insert $top_srcdir/customize/customize-synopsis.pod:__CUSTOMIZE_SYNOPSIS__ \
- --insert $top_srcdir/customize/customize-options.pod:__CUSTOMIZE_OPTIONS__ \
+ --insert $top_srcdir/common/mlcustomize/customize-synopsis.pod:__CUSTOMIZE_SYNOPSIS__
\
+ --insert $top_srcdir/common/mlcustomize/customize-options.pod:__CUSTOMIZE_OPTIONS__ \
--ignore=--check-signatures,--no-check-signatures
$srcdir/../podcheck.pl virt-builder-repository.pod virt-builder-repository
diff --git a/common/mlcustomize/Makefile.am b/common/mlcustomize/Makefile.am
index 293a9d394..149a76175 100644
--- a/common/mlcustomize/Makefile.am
+++ b/common/mlcustomize/Makefile.am
@@ -18,12 +18,24 @@
include $(top_srcdir)/subdir-rules.mk
EXTRA_DIST = \
+ $(generator_built) \
$(SOURCES_MLI) \
$(SOURCES_ML) \
$(SOURCES_C) \
test-firstboot.sh \
test-selinuxrelabel.sh
+# Note: So that I don't have to move many modules from virt-customize
+# to here, we don't compile customize_cmdline.ml into the mlcustomize
+# library. Instead virt-customize links to these files. They are
+# only located here because they have to be placed in common/ because
+# they are generated (since the repository split).
+generator_built = \
+ customize_cmdline.mli \
+ customize_cmdline.ml \
+ customize-options.pod \
+ customize-synopsis.pod
+
SOURCES_MLI = \
firstboot.mli \
SELinux_relabel.mli
diff --git a/common/mlv2v/Makefile.am b/common/mlv2v/Makefile.am
new file mode 100644
index 000000000..9e82148ac
--- /dev/null
+++ b/common/mlv2v/Makefile.am
@@ -0,0 +1,28 @@
+# libguestfs OCaml virt-v2v generated code
+# Copyright (C) 2011-2019 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.
+
+include $(top_srcdir)/subdir-rules.mk
+
+EXTRA_DIST = \
+ $(generator_built)
+
+# Note: These are not compiled into a library. They are used directly
+# by virt-v2v and are only located here because the files are
+# generated (since the split).
+generator_built = \
+ uefi.mli \
+ uefi.ml
diff --git a/configure.ac b/configure.ac
index ff3dc5e99..c15541c97 100644
--- a/configure.ac
+++ b/configure.ac
@@ -246,6 +246,7 @@ AC_CONFIG_FILES([Makefile
common/mlstdutils/guestfs_config.ml
common/mltools/Makefile
common/mlutils/Makefile
+ common/mlv2v/Makefile
common/mlvisit/Makefile
common/mlxml/Makefile
common/options/Makefile
diff --git a/customize/Makefile.am b/customize/Makefile.am
index 181cba2b4..7a76159ca 100644
--- a/customize/Makefile.am
+++ b/customize/Makefile.am
@@ -18,7 +18,6 @@
include $(top_srcdir)/subdir-rules.mk
EXTRA_DIST = \
- $(generator_built) \
$(SOURCES_MLI) $(SOURCES_ML) $(SOURCES_C) \
customize_main.ml \
test-password.pl \
@@ -27,12 +26,6 @@ EXTRA_DIST = \
test-virt-customize-docs.sh \
virt-customize.pod
-generator_built = \
- customize_cmdline.mli \
- customize_cmdline.ml \
- customize-options.pod \
- customize-synopsis.pod
-
SOURCES_MLI = \
append_line.mli \
crypt.mli \
@@ -67,6 +60,17 @@ SOURCES_C = \
crypt-c.c \
perl_edit-c.c
+BUILT_SOURCES = \
+ customize_cmdline.mli \
+ customize_cmdline.ml
+
+# These are created by the generator in common/mlcustomize and
+# need to be copied here.
+customize_cmdline.mli: $(top_srcdir)/common/mlcustomize/customize_cmdline.mli
+ cp $< $@
+customize_cmdline.ml: $(top_srcdir)/common/mlcustomize/customize_cmdline.ml
+ cp $< $@
+
if HAVE_OCAML
# Build the virt-customize objects into a library, since these are
@@ -193,12 +197,12 @@ noinst_DATA += $(top_builddir)/website/virt-customize.1.html
virt-customize.1 $(top_builddir)/website/virt-customize.1.html: stamp-virt-customize.pod
-stamp-virt-customize.pod: virt-customize.pod
$(top_srcdir)/customize/customize-synopsis.pod
$(top_srcdir)/customize/customize-options.pod
+stamp-virt-customize.pod: virt-customize.pod
$(top_srcdir)/common/mlcustomize/customize-synopsis.pod
$(top_srcdir)/common/mlcustomize/customize-options.pod
$(PODWRAPPER) \
--man virt-customize.1 \
--html $(top_builddir)/website/virt-customize.1.html \
- --insert $(top_srcdir)/customize/customize-synopsis.pod:__CUSTOMIZE_SYNOPSIS__ \
- --insert $(top_srcdir)/customize/customize-options.pod:__CUSTOMIZE_OPTIONS__ \
+ --insert
$(top_srcdir)/common/mlcustomize/customize-synopsis.pod:__CUSTOMIZE_SYNOPSIS__ \
+ --insert $(top_srcdir)/common/mlcustomize/customize-options.pod:__CUSTOMIZE_OPTIONS__
\
--license GPLv2+ \
--warning general \
$<
diff --git a/customize/test-virt-customize-docs.sh
b/customize/test-virt-customize-docs.sh
index ddaedea9f..99e67cb10 100755
--- a/customize/test-virt-customize-docs.sh
+++ b/customize/test-virt-customize-docs.sh
@@ -21,6 +21,6 @@ set -e
$TEST_FUNCTIONS
$top_srcdir/podcheck.pl virt-customize.pod virt-customize \
- --insert $top_srcdir/customize/customize-synopsis.pod:__CUSTOMIZE_SYNOPSIS__ \
- --insert $top_srcdir/customize/customize-options.pod:__CUSTOMIZE_OPTIONS__ \
+ --insert $top_srcdir/common/mlcustomize/customize-synopsis.pod:__CUSTOMIZE_SYNOPSIS__
\
+ --insert $top_srcdir/common/mlcustomize/customize-options.pod:__CUSTOMIZE_OPTIONS__ \
--ignore=--dryrun
diff --git a/docs/guestfs-hacking.pod b/docs/guestfs-hacking.pod
index 42035fdb6..3130f04f3 100644
--- a/docs/guestfs-hacking.pod
+++ b/docs/guestfs-hacking.pod
@@ -133,6 +133,10 @@ C<virt-sysprep>, C<virt-v2v> etc.)
OCaml bindings for C functions in C<common/utils>, and some POSIX
bindings which are missing from the OCaml stdlib.
+=item F<common/mlv2v>
+
+A few generated files used by virt-v2v.
+
=item F<common/mlvisit>
OCaml bindings for the visit functions (see F<common/visit>).
diff --git a/generator/main.ml b/generator/main.ml
index eff417536..741954e8e 100644
--- a/generator/main.ml
+++ b/generator/main.ml
@@ -347,18 +347,18 @@ Run it from the top source directory using the command
output_to "gobject/src/session.c"
GObject.generate_gobject_session_source;
- output_to "v2v/uefi.ml"
+ output_to "common/mlv2v/uefi.ml"
UEFI.generate_uefi_ml;
- output_to "v2v/uefi.mli"
+ output_to "common/mlv2v/uefi.mli"
UEFI.generate_uefi_mli;
- output_to "customize/customize_cmdline.mli"
+ output_to "common/mlcustomize/customize_cmdline.mli"
Customize.generate_customize_cmdline_mli;
- output_to "customize/customize_cmdline.ml"
+ output_to "common/mlcustomize/customize_cmdline.ml"
Customize.generate_customize_cmdline_ml;
- output_to "customize/customize-synopsis.pod"
+ output_to "common/mlcustomize/customize-synopsis.pod"
Customize.generate_customize_synopsis_pod;
- output_to "customize/customize-options.pod"
+ output_to "common/mlcustomize/customize-options.pod"
Customize.generate_customize_options_pod;
output_to "rust/src/guestfs.rs"
diff --git a/po-docs/podfiles b/po-docs/podfiles
index b0deb00df..d366a282a 100644
--- a/po-docs/podfiles
+++ b/po-docs/podfiles
@@ -8,8 +8,8 @@
../cat/virt-log.pod
../cat/virt-ls.pod
../cat/virt-tail.pod
-../customize/customize-options.pod
-../customize/customize-synopsis.pod
+../common/mlcustomize/customize-options.pod
+../common/mlcustomize/customize-synopsis.pod
../customize/virt-customize.pod
../daemon/guestfsd.pod
../df/virt-df.pod
diff --git a/v2v/Makefile.am b/v2v/Makefile.am
index 6e0829f81..4972b877e 100644
--- a/v2v/Makefile.am
+++ b/v2v/Makefile.am
@@ -17,18 +17,15 @@
include $(top_srcdir)/subdir-rules.mk
-generator_built = \
- uefi.ml \
- uefi.mli
-
BUILT_SOURCES = \
- $(generator_built) \
config.ml \
output_rhv_upload_createvm_source.ml \
output_rhv_upload_deletedisks_source.ml \
output_rhv_upload_plugin_source.ml \
output_rhv_upload_precheck_source.ml \
- output_rhv_upload_vmcheck_source.ml
+ output_rhv_upload_vmcheck_source.ml \
+ uefi.ml \
+ uefi.mli
EXTRA_DIST = \
$(SOURCES_MLI) $(SOURCES_ML) $(SOURCES_C) \
@@ -188,6 +185,13 @@ output_rhv_upload_precheck_source.ml:
$(srcdir)/rhv-upload-precheck.py
output_rhv_upload_vmcheck_source.ml: $(srcdir)/rhv-upload-vmcheck.py
$(srcdir)/embed.sh code $^ $@
+# These are created by the generator in common/mlv2v and
+# need to be copied here.
+uefi.mli: $(top_srcdir)/common/mlv2v/uefi.mli
+ cp $< $@
+uefi.ml: $(top_srcdir)/common/mlv2v/uefi.ml
+ cp $< $@
+
if HAVE_OCAML
bin_PROGRAMS = virt-v2v virt-v2v-copy-to-local
--
2.23.0