Fix one dist issue, and various builddir!=srcdir issues, also with the patch proposed in the Debian bug #946594. Patch #3 applies also to the virt-v2v repository, and will be committed there too (with references to the libguestfs commit). Pino Toscano (3): inspector: ship the actual test script tests: fix srcdir references build: fix make implicit dependencies on ml/mli files align/test-virt-alignment-scan-docs.sh | 2 +- builder/templates/Makefile.am | 4 +++- builder/templates/validate.sh | 4 ++-- builder/test-docs.sh | 4 ++-- builder/test-virt-index-validate.sh | 10 +++++----- cat/test-docs.sh | 10 +++++----- customize/test-virt-customize-docs.sh | 2 +- df/test-virt-df-docs.sh | 2 +- dib/test-virt-dib-docs.sh | 2 +- diff/test-virt-diff-docs.sh | 2 +- edit/test-virt-edit-docs.sh | 2 +- fish/test-docs.sh | 2 +- format/test-virt-format-docs.sh | 2 +- fuse/test-docs.sh | 4 ++-- get-kernel/test-virt-get-kernel-docs.sh | 2 +- inspector/Makefile.am | 2 +- inspector/test-virt-inspector-docs.sh | 2 +- inspector/test-virt-inspector-luks.sh | 2 +- inspector/test-virt-inspector.sh | 2 +- make-fs/test-virt-make-fs-docs.sh | 2 +- rescue/test-virt-rescue-docs.sh | 2 +- resize/test-virt-resize-docs.sh | 2 +- sparsify/test-virt-sparsify-docs.sh | 2 +- subdir-rules.mk | 6 +++--- sysprep/test-virt-sysprep-docs.sh | 2 +- test-tool/test-libguestfs-test-tool-docs.sh | 2 +- 26 files changed, 41 insertions(+), 39 deletions(-) -- 2.23.0
Pino Toscano
2019-Dec-17 14:45 UTC
[Libguestfs] [PATCH 1/3] inspector: ship the actual test script
It is no more generated by configure now; fixes commit 68f5c27adaea24626f6f9a606bbe032ede860da2. --- inspector/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inspector/Makefile.am b/inspector/Makefile.am index c1d0a788b..537dd631b 100644 --- a/inspector/Makefile.am +++ b/inspector/Makefile.am @@ -35,7 +35,7 @@ EXTRA_DIST = \ test-virt-inspector.sh \ test-virt-inspector-luks.sh \ test-virt-inspector-docs.sh \ - test-xmllint.sh.in \ + test-xmllint.sh \ virt-inspector.pod docdir = @docdir@ -- 2.23.0
Make sure to properly reference to files in the source directory. --- align/test-virt-alignment-scan-docs.sh | 2 +- builder/templates/Makefile.am | 4 +++- builder/templates/validate.sh | 4 ++-- builder/test-docs.sh | 4 ++-- builder/test-virt-index-validate.sh | 10 +++++----- cat/test-docs.sh | 10 +++++----- customize/test-virt-customize-docs.sh | 2 +- df/test-virt-df-docs.sh | 2 +- dib/test-virt-dib-docs.sh | 2 +- diff/test-virt-diff-docs.sh | 2 +- edit/test-virt-edit-docs.sh | 2 +- fish/test-docs.sh | 2 +- format/test-virt-format-docs.sh | 2 +- fuse/test-docs.sh | 4 ++-- get-kernel/test-virt-get-kernel-docs.sh | 2 +- inspector/test-virt-inspector-docs.sh | 2 +- inspector/test-virt-inspector-luks.sh | 2 +- inspector/test-virt-inspector.sh | 2 +- make-fs/test-virt-make-fs-docs.sh | 2 +- rescue/test-virt-rescue-docs.sh | 2 +- resize/test-virt-resize-docs.sh | 2 +- sparsify/test-virt-sparsify-docs.sh | 2 +- sysprep/test-virt-sysprep-docs.sh | 2 +- test-tool/test-libguestfs-test-tool-docs.sh | 2 +- 24 files changed, 37 insertions(+), 35 deletions(-) diff --git a/align/test-virt-alignment-scan-docs.sh b/align/test-virt-alignment-scan-docs.sh index a47cb3fc0..6a37712bb 100755 --- a/align/test-virt-alignment-scan-docs.sh +++ b/align/test-virt-alignment-scan-docs.sh @@ -21,4 +21,4 @@ set -e $TEST_FUNCTIONS skip_if_skipped -$top_srcdir/podcheck.pl virt-alignment-scan.pod virt-alignment-scan +$top_srcdir/podcheck.pl "$srcdir/virt-alignment-scan.pod" virt-alignment-scan diff --git a/builder/templates/Makefile.am b/builder/templates/Makefile.am index b070dba4d..5e84467fc 100644 --- a/builder/templates/Makefile.am +++ b/builder/templates/Makefile.am @@ -39,7 +39,9 @@ $(top_builddir)/website/download/builder/index: $(index_fragments) @echo " gpg --clearsign --armor $@" # Validates the index file. -TESTS_ENVIRONMENT = $(top_builddir)/run --test +TESTS_ENVIRONMENT = \ + top_srcdir="$(top_srcdir)" \ + $(top_builddir)/run --test TESTS = validate.sh check-valgrind: diff --git a/builder/templates/validate.sh b/builder/templates/validate.sh index 2796be39b..b760bbf25 100755 --- a/builder/templates/validate.sh +++ b/builder/templates/validate.sh @@ -24,8 +24,8 @@ fn=test-filename-for-index-validate rm -f $fn touch $fn -$VG virt-index-validate ../../website/download/builder/index -$VG virt-index-validate ../../website/download/builder/index.asc +$VG virt-index-validate "$top_srcdir/website/download/builder/index" +$VG virt-index-validate "$top_srcdir/website/download/builder/index.asc" $VG virt-index-validate $fn rm $fn diff --git a/builder/test-docs.sh b/builder/test-docs.sh index 7cac4fe2d..95b16961e 100755 --- a/builder/test-docs.sh +++ b/builder/test-docs.sh @@ -21,9 +21,9 @@ set -e $TEST_FUNCTIONS skip_if_skipped -$top_srcdir/podcheck.pl virt-builder.pod virt-builder \ +$top_srcdir/podcheck.pl "$srcdir/virt-builder.pod" virt-builder \ --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 +$srcdir/../podcheck.pl "$srcdir/virt-builder-repository.pod" virt-builder-repository diff --git a/builder/test-virt-index-validate.sh b/builder/test-virt-index-validate.sh index 851285a1e..96304394f 100755 --- a/builder/test-virt-index-validate.sh +++ b/builder/test-virt-index-validate.sh @@ -19,8 +19,8 @@ export LANG=C set -e -! $VG virt-index-validate test-virt-index-validate-bad-1 -$VG virt-index-validate test-virt-index-validate-good-1 -$VG virt-index-validate test-virt-index-validate-good-2 -$VG virt-index-validate test-virt-index-validate-good-3 -$VG virt-index-validate test-virt-index-validate-good-4 +! $VG virt-index-validate "$srcdir/test-virt-index-validate-bad-1" +$VG virt-index-validate "$srcdir/test-virt-index-validate-good-1" +$VG virt-index-validate "$srcdir/test-virt-index-validate-good-2" +$VG virt-index-validate "$srcdir/test-virt-index-validate-good-3" +$VG virt-index-validate "$srcdir/test-virt-index-validate-good-4" diff --git a/cat/test-docs.sh b/cat/test-docs.sh index 0d6d5461a..cf6a40262 100755 --- a/cat/test-docs.sh +++ b/cat/test-docs.sh @@ -21,14 +21,14 @@ set -e $TEST_FUNCTIONS skip_if_skipped -$top_srcdir/podcheck.pl virt-cat.pod virt-cat \ +$top_srcdir/podcheck.pl "$srcdir/virt-cat.pod" virt-cat \ --path $top_srcdir/common/options -$top_srcdir/podcheck.pl virt-filesystems.pod virt-filesystems \ +$top_srcdir/podcheck.pl "$srcdir/virt-filesystems.pod" virt-filesystems \ --path $top_srcdir/common/options -$top_srcdir/podcheck.pl virt-log.pod virt-log \ +$top_srcdir/podcheck.pl "$srcdir/virt-log.pod" virt-log \ --path $top_srcdir/common/options -$top_srcdir/podcheck.pl virt-ls.pod virt-ls \ +$top_srcdir/podcheck.pl "$srcdir/virt-ls.pod" virt-ls \ --path $top_srcdir/common/options \ --ignore=--checksums,--extra-stat,--time,--uid -$top_srcdir/podcheck.pl virt-tail.pod virt-tail \ +$top_srcdir/podcheck.pl "$srcdir/virt-tail.pod" virt-tail \ --path $top_srcdir/common/options diff --git a/customize/test-virt-customize-docs.sh b/customize/test-virt-customize-docs.sh index 9a8da5180..91ed39587 100755 --- a/customize/test-virt-customize-docs.sh +++ b/customize/test-virt-customize-docs.sh @@ -20,7 +20,7 @@ set -e $TEST_FUNCTIONS -$top_srcdir/podcheck.pl virt-customize.pod virt-customize \ +$top_srcdir/podcheck.pl "$srcdir/virt-customize.pod" virt-customize \ --path $top_srcdir/common/options \ --insert $top_srcdir/common/mlcustomize/customize-synopsis.pod:__CUSTOMIZE_SYNOPSIS__ \ --insert $top_srcdir/common/mlcustomize/customize-options.pod:__CUSTOMIZE_OPTIONS__ \ diff --git a/df/test-virt-df-docs.sh b/df/test-virt-df-docs.sh index 94061d1a8..76a933e2b 100755 --- a/df/test-virt-df-docs.sh +++ b/df/test-virt-df-docs.sh @@ -20,4 +20,4 @@ set -e $TEST_FUNCTIONS -$top_srcdir/podcheck.pl virt-df.pod virt-df +$top_srcdir/podcheck.pl "$srcdir/virt-df.pod" virt-df diff --git a/dib/test-virt-dib-docs.sh b/dib/test-virt-dib-docs.sh index 3363c9e59..2ce7223f3 100755 --- a/dib/test-virt-dib-docs.sh +++ b/dib/test-virt-dib-docs.sh @@ -20,4 +20,4 @@ set -e $TEST_FUNCTIONS -$top_srcdir/podcheck.pl virt-dib.pod virt-dib +$top_srcdir/podcheck.pl "$srcdir/virt-dib.pod" virt-dib diff --git a/diff/test-virt-diff-docs.sh b/diff/test-virt-diff-docs.sh index d0d93cfd2..495befb03 100755 --- a/diff/test-virt-diff-docs.sh +++ b/diff/test-virt-diff-docs.sh @@ -20,6 +20,6 @@ set -e $TEST_FUNCTIONS -$top_srcdir/podcheck.pl virt-diff.pod virt-diff \ +$top_srcdir/podcheck.pl "$srcdir/virt-diff.pod" virt-diff \ --path $top_srcdir/common/options \ --ignore=--checksums,--dir-link,--dir-nlink,--dir-nlinks,--dir-time,--extra-stat,--time,--uid,--xattr diff --git a/edit/test-virt-edit-docs.sh b/edit/test-virt-edit-docs.sh index 7805d7e1d..ce26bebd1 100755 --- a/edit/test-virt-edit-docs.sh +++ b/edit/test-virt-edit-docs.sh @@ -20,5 +20,5 @@ set -e $TEST_FUNCTIONS -$top_srcdir/podcheck.pl virt-edit.pod virt-edit \ +$top_srcdir/podcheck.pl "$srcdir/virt-edit.pod" virt-edit \ --path $top_srcdir/common/options diff --git a/fish/test-docs.sh b/fish/test-docs.sh index 7e9f9928e..52f482906 100755 --- a/fish/test-docs.sh +++ b/fish/test-docs.sh @@ -21,6 +21,6 @@ set -e $TEST_FUNCTIONS skip_if_skipped -$top_srcdir/podcheck.pl guestfish.pod guestfish \ +$top_srcdir/podcheck.pl "$srcdir/guestfish.pod" guestfish \ --path $srcdir --path $top_srcdir/common/options \ --ignore=-D diff --git a/format/test-virt-format-docs.sh b/format/test-virt-format-docs.sh index 27275f08b..866d33214 100755 --- a/format/test-virt-format-docs.sh +++ b/format/test-virt-format-docs.sh @@ -21,4 +21,4 @@ set -e $TEST_FUNCTIONS skip_if_skipped -$top_srcdir/podcheck.pl virt-format.pod virt-format +$top_srcdir/podcheck.pl "$srcdir/virt-format.pod" virt-format diff --git a/fuse/test-docs.sh b/fuse/test-docs.sh index 0edc25658..29db079bd 100755 --- a/fuse/test-docs.sh +++ b/fuse/test-docs.sh @@ -21,9 +21,9 @@ set -e $TEST_FUNCTIONS skip_if_skipped -$top_srcdir/podcheck.pl guestmount.pod guestmount \ +$top_srcdir/podcheck.pl "$srcdir/guestmount.pod" guestmount \ --path $top_srcdir/common/options # guestunmount doesn't implement bash completion, so we cannot # test it at the moment. XXX -#$top_srcdir/podcheck.pl guestunmount.pod guestunmount +#$top_srcdir/podcheck.pl "$srcdir/guestunmount.pod" guestunmount diff --git a/get-kernel/test-virt-get-kernel-docs.sh b/get-kernel/test-virt-get-kernel-docs.sh index 40bb7334d..206ca7f24 100755 --- a/get-kernel/test-virt-get-kernel-docs.sh +++ b/get-kernel/test-virt-get-kernel-docs.sh @@ -21,5 +21,5 @@ set -e $TEST_FUNCTIONS skip_if_skipped -$top_srcdir/podcheck.pl virt-get-kernel.pod virt-get-kernel \ +$top_srcdir/podcheck.pl "$srcdir/virt-get-kernel.pod" virt-get-kernel \ --path $top_srcdir/common/options diff --git a/inspector/test-virt-inspector-docs.sh b/inspector/test-virt-inspector-docs.sh index 11ee6518f..bbfc8ff1c 100755 --- a/inspector/test-virt-inspector-docs.sh +++ b/inspector/test-virt-inspector-docs.sh @@ -21,5 +21,5 @@ set -e $TEST_FUNCTIONS skip_if_skipped -$top_srcdir/podcheck.pl virt-inspector.pod virt-inspector \ +$top_srcdir/podcheck.pl "$srcdir/virt-inspector.pod" virt-inspector \ --path $top_srcdir/common/options diff --git a/inspector/test-virt-inspector-luks.sh b/inspector/test-virt-inspector-luks.sh index 9cb062ec4..60aba1f08 100755 --- a/inspector/test-virt-inspector-luks.sh +++ b/inspector/test-virt-inspector-luks.sh @@ -38,5 +38,5 @@ if [ -s "$f" ]; then $XMLLINT --noout --relaxng "$srcdir/virt-inspector.rng" "actual-$b.xml" # This 'diff' command will fail (because of -e option) if there # are any differences. - diff -ur $diff_ignore "expected-$b.xml" "actual-$b.xml" + diff -ur $diff_ignore "$srcdir/expected-$b.xml" "actual-$b.xml" fi diff --git a/inspector/test-virt-inspector.sh b/inspector/test-virt-inspector.sh index 139e68e42..430b4c7bb 100755 --- a/inspector/test-virt-inspector.sh +++ b/inspector/test-virt-inspector.sh @@ -34,7 +34,7 @@ for f in ../test-data/phony-guests/{debian,fedora,ubuntu,archlinux,coreos,window $XMLLINT --noout --relaxng "$srcdir/virt-inspector.rng" "actual-$b.xml" # This 'diff' command will fail (because of -e option) if there # are any differences. - diff -ur $diff_ignore "expected-$b.xml" "actual-$b.xml" + diff -ur $diff_ignore "$srcdir/expected-$b.xml" "actual-$b.xml" fi done diff --git a/make-fs/test-virt-make-fs-docs.sh b/make-fs/test-virt-make-fs-docs.sh index c6df103ca..a4aa7ac51 100755 --- a/make-fs/test-virt-make-fs-docs.sh +++ b/make-fs/test-virt-make-fs-docs.sh @@ -21,4 +21,4 @@ set -e $TEST_FUNCTIONS skip_if_skipped -$top_srcdir/podcheck.pl virt-make-fs.pod virt-make-fs --ignore=--debug +$top_srcdir/podcheck.pl "$srcdir/virt-make-fs.pod" virt-make-fs --ignore=--debug diff --git a/rescue/test-virt-rescue-docs.sh b/rescue/test-virt-rescue-docs.sh index e5fbf26f4..8ec6c0160 100755 --- a/rescue/test-virt-rescue-docs.sh +++ b/rescue/test-virt-rescue-docs.sh @@ -21,5 +21,5 @@ set -e $TEST_FUNCTIONS skip_if_skipped -$top_srcdir/podcheck.pl virt-rescue.pod virt-rescue \ +$top_srcdir/podcheck.pl "$srcdir/virt-rescue.pod" virt-rescue \ --ignore=--suggest diff --git a/resize/test-virt-resize-docs.sh b/resize/test-virt-resize-docs.sh index 8245655e7..a9e4a4ddf 100755 --- a/resize/test-virt-resize-docs.sh +++ b/resize/test-virt-resize-docs.sh @@ -21,5 +21,5 @@ set -e $TEST_FUNCTIONS skip_if_skipped -$top_srcdir/podcheck.pl virt-resize.pod virt-resize \ +$top_srcdir/podcheck.pl "$srcdir/virt-resize.pod" virt-resize \ --ignore=--LVexpand,--lv-expand,--lvexpand,--dryrun diff --git a/sparsify/test-virt-sparsify-docs.sh b/sparsify/test-virt-sparsify-docs.sh index 6c2bd8f89..01d390c79 100755 --- a/sparsify/test-virt-sparsify-docs.sh +++ b/sparsify/test-virt-sparsify-docs.sh @@ -21,6 +21,6 @@ set -e $TEST_FUNCTIONS skip_if_skipped -$top_srcdir/podcheck.pl virt-sparsify.pod virt-sparsify \ +$top_srcdir/podcheck.pl "$srcdir/virt-sparsify.pod" virt-sparsify \ --path $top_srcdir/common/options \ --ignore=--inplace diff --git a/sysprep/test-virt-sysprep-docs.sh b/sysprep/test-virt-sysprep-docs.sh index b31e0f097..51500b5e9 100755 --- a/sysprep/test-virt-sysprep-docs.sh +++ b/sysprep/test-virt-sysprep-docs.sh @@ -21,7 +21,7 @@ set -e $TEST_FUNCTIONS skip_if_skipped -$top_srcdir/podcheck.pl virt-sysprep.pod virt-sysprep \ +$top_srcdir/podcheck.pl "$srcdir/virt-sysprep.pod" virt-sysprep \ --path $top_srcdir/common/options \ --insert sysprep-extra-options.pod:__EXTRA_OPTIONS__ \ --insert sysprep-operations.pod:__OPERATIONS__ \ diff --git a/test-tool/test-libguestfs-test-tool-docs.sh b/test-tool/test-libguestfs-test-tool-docs.sh index 234a1408f..589fe8bb0 100755 --- a/test-tool/test-libguestfs-test-tool-docs.sh +++ b/test-tool/test-libguestfs-test-tool-docs.sh @@ -21,5 +21,5 @@ set -e $TEST_FUNCTIONS skip_if_skipped -$top_srcdir/podcheck.pl libguestfs-test-tool.pod libguestfs-test-tool \ +$top_srcdir/podcheck.pl "$srcdir/libguestfs-test-tool.pod" libguestfs-test-tool \ --ignore=-? -- 2.23.0
Pino Toscano
2019-Dec-17 14:45 UTC
[Libguestfs] [PATCH 3/3] build: fix make implicit dependencies on ml/mli files
As proposed in the Debian bug #946594 [1], the implicit .cmi/.cmo/.cmx dependencies are tied to files in the source directory only, and thus they break when either the .ml or the .mli files are in the build directory. Since there is already VPATH set up by automake, rely on it to locate the right source. [1] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=946594#36 Solution proposed by Vincent Danjean, thanks! This reverts commit 802c5d2055593adf6bfae796b102b8c902de571e in this file. --- subdir-rules.mk | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/subdir-rules.mk b/subdir-rules.mk index 3a20cb10d..a789a82f6 100644 --- a/subdir-rules.mk +++ b/subdir-rules.mk @@ -79,12 +79,12 @@ guestfs_am_v_jar = $(guestfs_am_v_jar_@AM_V@) guestfs_am_v_jar_ = $(guestfs_am_v_jar_@AM_DEFAULT_V@) guestfs_am_v_jar_0 = @echo " JAR " $@; -%.cmi: $(srcdir)/%.mli +%.cmi: %.mli $(guestfs_am_v_ocamlcmi)$(OCAMLFIND) ocamlc $(OCAMLFLAGS) $(OCAMLPACKAGES) -c $< -o $@ -%.cmo: $(srcdir)/%.ml +%.cmo: %.ml $(guestfs_am_v_ocamlc)$(OCAMLFIND) ocamlc $(OCAMLFLAGS) $(OCAMLPACKAGES) -c $< -o $@ if HAVE_OCAMLOPT -%.cmx: $(srcdir)/%.ml +%.cmx: %.ml $(guestfs_am_v_ocamlopt)$(OCAMLFIND) ocamlopt $(OCAMLFLAGS) $(OCAMLPACKAGES) -c $< -o $@ endif -- 2.23.0
Pino Toscano
2019-Dec-17 15:32 UTC
[Libguestfs] [PATCH 4/3] build: exclude common/mlv2v from distcheck
It is part of the common submodule but not used in libguestfs, so it is not included in distribution tarballs. --- Makefile.am | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile.am b/Makefile.am index 1def6e0a3..d3cf64cc1 100644 --- a/Makefile.am +++ b/Makefile.am @@ -580,6 +580,7 @@ maintainer-check-extra-dist: ( git ls-files ; \ cd common; git ls-files | sed 's,^,common/,' ) | \ grep -v '^common$$' | \ + grep -v '^common/mlv2v/' | \ grep -v '^intltool-.*\.in' | \ grep -v '^\.gitmodules' | \ grep -v '^\.gnulib' | \ @@ -589,7 +590,7 @@ maintainer-check-extra-dist: cat tmp/comm-out [ ! -s tmp/comm-out ] @echo Checking for generated files missing from the tarball ... - @for f in `cat generator/files-generated.txt`; do \ + @for f in `cat generator/files-generated.txt | grep -v '^common/mlv2v/'`; do \ if ! grep -sq "^$$f\$$" tmp/tarfiles; then \ echo generated file missing from tarball: $$f; \ exit 1; \ -- 2.23.0
Richard W.M. Jones
2020-Jan-09 13:29 UTC
Re: [Libguestfs] [PATCH 4/3] build: exclude common/mlv2v from distcheck
ACK series. Patch 3 is interesting, I'll be interested to see if that ever causes a problem (eg. if we had two same-named OCaml modules in different directories?), but let's take it anyway. The other patches are obvious. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-top is 'top' for virtual machines. Tiny program with many powerful monitoring features, net stats, disk stats, logging, etc. http://people.redhat.com/~rjones/virt-top
Possibly Parallel Threads
- [PATCH 1/2] podcheck: __INCLUDE:file.pod__ and __VERBATIM:file.txt__ in POD files.
- [PATCH 0/3] tests: Define common test functions.
- [PATCH 0/9] Adaptations to Weblate
- [PATCH 0/3] podwrapper: Generate consistent WARNING sections (RHBZ#1293527).
- [PATCH v2 0/3] options: Describe --key SELECTOR in a single file.