generator, customize, v2v: Only place generated files in libguestfs or common.

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.
This commit is contained in:
Richard W.M. Jones
2019-10-14 16:26:46 +01:00
parent a07b9a2cda
commit 20c2dfbe00
13 changed files with 91 additions and 33 deletions

8
.gitignore vendored
View File

@@ -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

View File

@@ -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

View File

@@ -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 \
$<

View File

@@ -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

View File

@@ -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

28
common/mlv2v/Makefile.am Normal file
View File

@@ -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

View File

@@ -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

View File

@@ -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 \
$<

View File

@@ -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

View File

@@ -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>).

View File

@@ -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"

View File

@@ -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

View File

@@ -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