two small patches to appease clang/llvm static analysis
by Jim Meyering
I ran libguestfs through llvm+clang, today,
[http://clang.llvm.org/StaticAnalysis.html]
It found only two things worth changing -- neither is a real problems.
Adding the noreturn makes it so the tool understands line 541 of
guestfs.c is truly reachable only for non-NULL "p":
540 if (!p) g->abort_cb ();
541 memcpy (p, ptr, size);
>From 41f8b506924243d4fd7570913fbbbd9f8040e11f Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering(a)redhat.com>
Date: Mon, 31 Aug 2009 19:51:46 +0200
Subject: [PATCH libguestfs 1/2] maint: guestfs.c: remove unnecessary initialization
* src/guestfs.c (guestfs__receive_file_sync): Don't set "r",
only to ignore it.
---
src/guestfs.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/src/guestfs.c b/src/guestfs.c
index 145f0f3..20afb63 100644
--- a/src/guestfs.c
+++ b/src/guestfs.c
@@ -2413,7 +2413,7 @@ guestfs__receive_file_sync (guestfs_h *g, const char *filename)
return -1;
}
- while ((r = receive_file_data_sync (g, NULL, NULL)) > 0)
+ while (receive_file_data_sync (g, NULL, NULL) > 0)
; /* just discard it */
return -1;
--
1.6.4.2.384.g5fc62
>From 97ef6a82ed32404b751a23b6658e0f9c7ab3298c Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering(a)redhat.com>
Date: Mon, 31 Aug 2009 20:29:08 +0200
Subject: [PATCH libguestfs 2/2] maint: guestfs.c: avoid warning about possible NULL deref from llvm/clang
* src/guestfs.h (guestfs_abort_cb): Declare with attribute noreturn.
---
src/guestfs.h | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/src/guestfs.h b/src/guestfs.h
index f2e108b..6412a53 100644
--- a/src/guestfs.h
+++ b/src/guestfs.h
@@ -41,7 +41,7 @@ extern void guestfs_close (guestfs_h *g);
extern const char *guestfs_last_error (guestfs_h *g);
typedef void (*guestfs_error_handler_cb) (guestfs_h *g, void *data, const char *msg);
-typedef void (*guestfs_abort_cb) (void);
+typedef void (*guestfs_abort_cb) (void) __attribute__((__noreturn__));
extern void guestfs_set_error_handler (guestfs_h *g, guestfs_error_handler_cb cb, void *data);
extern guestfs_error_handler_cb guestfs_get_error_handler (guestfs_h *g, void **data_rtn);
--
1.6.4.2.384.g5fc62
15 years, 2 months
[PATCHES] avoid more warnings
by Jim Meyering
>From 23740528cd2d75a236aae1fb5d073e8be2e5a295 Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering(a)redhat.com>
Date: Fri, 28 Aug 2009 13:43:16 +0200
Subject: [PATCH libguestfs 1/3] generator.ml: avoid warnings in generated ocaml/guestfs_c_actions.c
* src/generator.ml: Emit prototypes for ocaml_guestfs_* functions,
to avoid warnings from gcc -Wmissing-prototypes. Normally we'd put
these somewhere else, but in this unusual case, they're not needed
anywhere else. Handle the >5-argument case, too, for these:
ocaml_guestfs_test0_byte, ocaml_guestfs_sfdisk_byte,
ocaml_guestfs_sfdisk_N_byte.
---
src/generator.ml | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/src/generator.ml b/src/generator.ml
index 46fcf2c..fa7d240 100755
--- a/src/generator.ml
+++ b/src/generator.ml
@@ -6770,6 +6770,10 @@ copy_table (char * const * argv)
let needs_extra_vs =
match fst style with RConstOptString _ -> true | _ -> false in
+ pr "/* Emit prototype to appease gcc's -Wmissing-prototypes. */\n";
+ pr "CAMLprim value ocaml_guestfs_%s (value %s" name (List.hd params);
+ List.iter (pr ", value %s") (List.tl params); pr ");\n";
+
pr "CAMLprim value\n";
pr "ocaml_guestfs_%s (value %s" name (List.hd params);
List.iter (pr ", value %s") (List.tl params);
@@ -6903,6 +6907,9 @@ copy_table (char * const * argv)
pr "\n";
if List.length params > 5 then (
+ pr "/* Emit prototype to appease gcc's -Wmissing-prototypes. */\n";
+ pr "CAMLprim value ";
+ pr "ocaml_guestfs_%s_byte (value *argv, int argn);\n" name;
pr "CAMLprim value\n";
pr "ocaml_guestfs_%s_byte (value *argv, int argn)\n" name;
pr "{\n";
--
1.6.4.1.373.g81fb2
>From ba5842c1147f4463fce7f613618938fd5b9a1c1a Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering(a)redhat.com>
Date: Fri, 28 Aug 2009 13:53:36 +0200
Subject: [PATCH libguestfs 2/3] generator.ml: avoid defined-but-not-used warnings in guestfs_c_actions.c
* src/generator.ml (emit_ocaml_copy_list_function): New function.
Emit a function definition only if it will be used.
---
src/generator.ml | 53 ++++++++++++++++++++++++++++++++---------------------
1 files changed, 32 insertions(+), 21 deletions(-)
diff --git a/src/generator.ml b/src/generator.ml
index fa7d240..569e1a1 100755
--- a/src/generator.ml
+++ b/src/generator.ml
@@ -6692,6 +6692,29 @@ copy_table (char * const * argv)
";
(* Struct copy functions. *)
+
+ let emit_ocaml_copy_list_function typ =
+ pr "static CAMLprim value\n";
+ pr "copy_%s_list (const struct guestfs_%s_list *%ss)\n" typ typ typ;
+ pr "{\n";
+ pr " CAMLparam0 ();\n";
+ pr " CAMLlocal2 (rv, v);\n";
+ pr " unsigned int i;\n";
+ pr "\n";
+ pr " if (%ss->len == 0)\n" typ;
+ pr " CAMLreturn (Atom (0));\n";
+ pr " else {\n";
+ pr " rv = caml_alloc (%ss->len, 0);\n" typ;
+ pr " for (i = 0; i < %ss->len; ++i) {\n" typ;
+ pr " v = copy_%s (&%ss->val[i]);\n" typ typ;
+ pr " caml_modify (&Field (rv, i), v);\n";
+ pr " }\n";
+ pr " CAMLreturn (rv);\n";
+ pr " }\n";
+ pr "}\n";
+ pr "\n";
+ in
+
List.iter (
fun (typ, cols) ->
let has_optpercent_col =
@@ -6738,29 +6761,17 @@ copy_table (char * const * argv)
pr " CAMLreturn (rv);\n";
pr "}\n";
pr "\n";
-
- pr "static CAMLprim value\n";
- pr "copy_%s_list (const struct guestfs_%s_list *%ss)\n"
- typ typ typ;
- pr "{\n";
- pr " CAMLparam0 ();\n";
- pr " CAMLlocal2 (rv, v);\n";
- pr " int i;\n";
- pr "\n";
- pr " if (%ss->len == 0)\n" typ;
- pr " CAMLreturn (Atom (0));\n";
- pr " else {\n";
- pr " rv = caml_alloc (%ss->len, 0);\n" typ;
- pr " for (i = 0; i < %ss->len; ++i) {\n" typ;
- pr " v = copy_%s (&%ss->val[i]);\n" typ typ;
- pr " caml_modify (&Field (rv, i), v);\n";
- pr " }\n";
- pr " CAMLreturn (rv);\n";
- pr " }\n";
- pr "}\n";
- pr "\n";
) structs;
+ (* Emit a copy_TYPE_list function definition only if that function is used. *)
+ List.iter (
+ function
+ | typ, (RStructListOnly | RStructAndList) ->
+ (* generate the function for typ *)
+ emit_ocaml_copy_list_function typ
+ | typ, _ -> () (* empty *)
+ ) rstructs_used;
+
(* The wrappers. *)
List.iter (
fun (name, style, _, _, _, _, _) ->
--
1.6.4.1.373.g81fb2
>From de81a7d930a6a2ad558eff9396da20237e06ccc1 Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering(a)redhat.com>
Date: Fri, 28 Aug 2009 14:07:35 +0200
Subject: [PATCH libguestfs 3/3] generator.ml: avoid a warning about signed overflow in tests.c
* src/generator.ml: Emit "unsigned long int n_failed;" rather than
"int failed;", to avoid warning from gcc about "assuming signed
overflow does not occur when simplifying conditional to constant".
---
src/generator.ml | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/generator.ml b/src/generator.ml
index 569e1a1..2e2b70e 100755
--- a/src/generator.ml
+++ b/src/generator.ml
@@ -5379,7 +5379,7 @@ static void print_table (char const *const *argv)
int main (int argc, char *argv[])
{
char c = 0;
- int failed = 0;
+ unsigned long int n_failed = 0;
const char *filename;
int fd;
int nr_tests, test_num = 0;
@@ -5513,7 +5513,7 @@ int main (int argc, char *argv[])
pr " printf (\"%%3d/%%3d %s\\n\", test_num, nr_tests);\n" test_name;
pr " if (%s () == -1) {\n" test_name;
pr " printf (\"%s FAILED\\n\");\n" test_name;
- pr " failed++;\n";
+ pr " n_failed++;\n";
pr " }\n";
) test_names;
pr "\n";
@@ -5524,8 +5524,8 @@ int main (int argc, char *argv[])
pr " unlink (\"test3.img\");\n";
pr "\n";
- pr " if (failed > 0) {\n";
- pr " printf (\"***** %%d / %%d tests FAILED *****\\n\", failed, nr_tests);\n";
+ pr " if (n_failed > 0) {\n";
+ pr " printf (\"***** %%lu / %%d tests FAILED *****\\n\", n_failed, nr_tests);\n";
pr " exit (1);\n";
pr " }\n";
pr "\n";
--
1.6.4.1.373.g81fb2
15 years, 2 months
[PATCH 4/4] build: enable gcc warnings in capitests/ and ocaml/
by Jim Meyering
Here are four small patches.
First, I enabled all the warnings, then I fixed the newly exposed
offenses, then I put the warning-enabling patch at the end,
for the sake of future bisectors:
[1/4] ocaml/guestfs_c.c avoid signed/unsigned-comparison warning
[2/4] ocaml/guestfs_c.c: avoid warning about initialization discarding "const"
[3/4] ocaml/guestfs_c.c: avoid warning about missing prototypes
[4/4] build: enable gcc warnings in capitests/ and ocaml/
>From 1accb67720596bd946809d4032661f5d3adb7a26 Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering(a)redhat.com>
Date: Thu, 27 Aug 2009 12:34:38 +0200
Subject: [PATCH libguestfs 1/4] ocaml/guestfs_c.c avoid signed/unsigned-comparison warning
* ocaml/guestfs_c.c (ocaml_guestfs_strings_val): Declare index as
unsigned int.
---
ocaml/guestfs_c.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/ocaml/guestfs_c.c b/ocaml/guestfs_c.c
index f983696..9a7454d 100644
--- a/ocaml/guestfs_c.c
+++ b/ocaml/guestfs_c.c
@@ -131,7 +131,7 @@ ocaml_guestfs_strings_val (guestfs_h *g, value sv)
{
CAMLparam1 (sv);
char **r;
- int i;
+ unsigned int i;
r = guestfs_safe_malloc (g, sizeof (char *) * (Wosize_val (sv) + 1));
for (i = 0; i < Wosize_val (sv); ++i)
--
1.6.4.1.359.g4fc77
>From 27420d5dcf7ba550751323ea2f27cf45b9146a91 Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering(a)redhat.com>
Date: Thu, 27 Aug 2009 12:36:25 +0200
Subject: [PATCH libguestfs 2/4] ocaml/guestfs_c.c: avoid warning about initialization discarding "const"
* ocaml/guestfs_c.c (guestfs_custom_operations): Add a cast.
---
ocaml/guestfs_c.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/ocaml/guestfs_c.c b/ocaml/guestfs_c.c
index 9a7454d..62d42d3 100644
--- a/ocaml/guestfs_c.c
+++ b/ocaml/guestfs_c.c
@@ -51,7 +51,7 @@ guestfs_finalize (value gv)
}
static struct custom_operations guestfs_custom_operations = {
- "guestfs_custom_operations",
+ (char *) "guestfs_custom_operations",
guestfs_finalize,
custom_compare_default,
custom_hash_default,
--
1.6.4.1.359.g4fc77
>From 4125126085bd81bf96efc2cdbdec0f5596c6c9e8 Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering(a)redhat.com>
Date: Thu, 27 Aug 2009 13:23:20 +0200
Subject: [PATCH libguestfs 3/4] ocaml/guestfs_c.c: avoid warning about missing prototypes
* ocaml/guestfs_c.c (ocaml_guestfs_create, ocaml_guestfs_close): Declare.
---
ocaml/guestfs_c.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/ocaml/guestfs_c.c b/ocaml/guestfs_c.c
index 62d42d3..80dcf99 100644
--- a/ocaml/guestfs_c.c
+++ b/ocaml/guestfs_c.c
@@ -42,6 +42,10 @@
}while(0)
#endif
+/* These prototypes are solely to quiet gcc warning. */
+CAMLprim value ocaml_guestfs_create (void);
+CAMLprim value ocaml_guestfs_close (value gv);
+
/* Allocate handles and deal with finalization. */
static void
guestfs_finalize (value gv)
--
1.6.4.1.359.g4fc77
>From e933691fd1c1a5543c05fcd209ce57daf6cac4f7 Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering(a)redhat.com>
Date: Mon, 24 Aug 2009 11:39:42 +0200
Subject: [PATCH libguestfs 4/4] build: enable gcc warnings in capitests/ and ocaml/
* capitests/Makefile.am: Use $(WARN_CFLAGS) and $(WERROR_CFLAGS).
* ocaml/Makefile.am:: Likewise.
---
capitests/Makefile.am | 3 ++-
ocaml/Makefile.am | 3 ++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/capitests/Makefile.am b/capitests/Makefile.am
index 361c6a3..3b80c0e 100644
--- a/capitests/Makefile.am
+++ b/capitests/Makefile.am
@@ -24,7 +24,8 @@ EXTRA_DIST = \
check_PROGRAMS = tests test-command
tests_SOURCES = tests.c
-tests_CFLAGS = -I$(top_srcdir)/src -I$(top_builddir)/src -Wall
+tests_CFLAGS = -I$(top_srcdir)/src -I$(top_builddir)/src \
+ $(WARN_CFLAGS) $(WERROR_CFLAGS)
tests_LDADD = $(top_builddir)/src/libguestfs.la
# Old version of e2fsprogs which didn't support UUIDs?
diff --git a/ocaml/Makefile.am b/ocaml/Makefile.am
index d65ebaa..462404c 100644
--- a/ocaml/Makefile.am
+++ b/ocaml/Makefile.am
@@ -29,7 +29,8 @@ CLEANFILES = *.cmi *.cmo *.cmx *.cma *.cmxa *.o *.a *.so
CLEANFILES += t/*.cmi t/*.cmo t/*.cmx t/*.o t/*.a t/*.so
AM_CPPFLAGS = -I$(top_builddir) -I$(OCAMLLIB) -I$(top_srcdir)/ocaml \
- -I$(top_srcdir)/src -I$(top_builddir)/src
+ -I$(top_srcdir)/src -I$(top_builddir)/src \
+ $(WARN_CFLAGS) $(WERROR_CFLAGS)
if HAVE_OCAML
--
1.6.4.1.359.g4fc77
15 years, 2 months
[PATCH libguestfs 1/2] build: invoke autopoint and autoreconf with --force
by Jim Meyering
The last patch was incomplete, since autoreconf must also be
run with -f/--force.
This change also updates the gnulib submodule to the latest,
in order to pull in the progname change I made yesterday
to give sensible names in diagnostics like this one:
$ ./guestfish --version > /dev/full
guestfish: write error: No space left on device
Once the second change is pushed, you will have to run autogen.sh,
which will automatically rerun bootstrap to re-sync the gnulib/*
bits from the updated .gnulib repository.
>From a64c926f14cc5b287ab10039fe5be1521c3183e1 Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering(a)redhat.com>
Date: Tue, 25 Aug 2009 09:10:21 +0200
Subject: [PATCH libguestfs 1/2] build: invoke autopoint and autoreconf with --force
* bootstrap: Invoke autopoint with --force, to avoid warning
about existing build-aux/config.rpath.
* autogen.sh: Invoke autoreconf with --force, too.
---
autogen.sh | 2 +-
bootstrap | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/autogen.sh b/autogen.sh
index 5179623..f2e128f 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -33,7 +33,7 @@ else
fi
mkdir -p daemon/m4
-autoreconf -i
+autoreconf -i -f
CONFIGUREDIR=.
diff --git a/bootstrap b/bootstrap
index 2eba6a7..85afda8 100755
--- a/bootstrap
+++ b/bootstrap
@@ -29,7 +29,7 @@ GNULIB_SRCDIR=.gnulib
ls po/*.po 2>/dev/null | sed 's|.*/||; s|\.po$||' > po/LINGUAS
# Run autopoint, to get po/Makevars.template:
-autopoint
+autopoint -f
# Create gettext configuration.
echo "$0: Creating po/Makevars from po/Makevars.template ..."
--
1.6.4.1.322.g38eb7
>From 5e0007337cc17a67b5f3de56b15673dcda7f7813 Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering(a)redhat.com>
Date: Tue, 25 Aug 2009 09:43:04 +0200
Subject: [PATCH libguestfs 2/2] build: update gnulib submodule to latest
* .gnulib: Update to latest.
---
.gnulib | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/.gnulib b/.gnulib
index 7560950..52dec75 160000
--- a/.gnulib
+++ b/.gnulib
@@ -1 +1 @@
-Subproject commit 7560950d6efd9e209b8d7188e1a95ceb53035889
+Subproject commit 52dec75be71b6526bb42610f74beb013cb27f1f3
--
1.6.4.1.322.g38eb7
15 years, 2 months
[PATCH libguestfs] build: invoke autopoint with --force
by Jim Meyering
Without this, I'd see a warning about an existing
build-aux/config.rpath go by whenever bootstrap ran:
>From 4c1cc009cd04995acd05cfffa3c497403f8c7a55 Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering(a)redhat.com>
Date: Tue, 25 Aug 2009 09:10:21 +0200
Subject: [PATCH libguestfs] build: invoke autopoint with --force
* bootstrap: Invoke autopoint with --force, to avoid warning
about existing build-aux/config.rpath.
---
bootstrap | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/bootstrap b/bootstrap
index 2eba6a7..85afda8 100755
--- a/bootstrap
+++ b/bootstrap
@@ -29,7 +29,7 @@ GNULIB_SRCDIR=.gnulib
ls po/*.po 2>/dev/null | sed 's|.*/||; s|\.po$||' > po/LINGUAS
# Run autopoint, to get po/Makevars.template:
-autopoint
+autopoint -f
# Create gettext configuration.
echo "$0: Creating po/Makevars from po/Makevars.template ..."
--
1.6.4.1.322.g38eb7
15 years, 2 months
[0/5] guestfish: detect stdout-write failure
by Jim Meyering
Nearly any program that writes to standard output can
benefit from this sort of fix.
Without it, running e.g., ./guestfish --version > /dev/full
would exit successfully, even though it got ENOSPC
when writing to the full device. That means regular
output redirected to a file on a full partition may also
fail to be written, and the error ignored.
Before:
$ guestfish --version > /dev/full
After:
$ ./guestfish --version > /dev/full
/w/co/libguestfs/fish/.libs/lt-guestfish: write error: No space left on device
Obviously, including the absolute program name in the diagnostic is a bug.
It should be "guestfish", and there's already code to perform that
sanitization in the patch below. It fixes everything except the glibc
global variable, program_invocation_name, used by error, called by
atexit+close_stdout. I'll fix that via gnulib's progname module later
today or tomorrow. Note that all other diagnostics (e.g., below) do
use the sanitized name.
The second patch is to make guestfish write --help output
to stdout, not stderr, per convention. Also, since --help
output is pretty long, I find it clearer (e.g., when I misspell
an option) to write a brief diagnostic, like
$ ./guestfish --fjd
guestfish: unrecognized option '--fjd'
Try `guestfish --help' for more information.
[Exit 1]
The third patch is another small improvement: let getopt diagnose failures.
Before, using --mount with no option-argument would print a
misleading diagnostic:
$ ./guestfish -m
guestfish: unexpected command line option 0x3f
...all --help output...
[Exit 1]
Now it prints this:
$ ./guestfish -m
guestfish: option requires an argument -- 'm'
Try `guestfish --help' for more information.
[Exit 1]
------------------------------
The fourth patch makes the Before/After change demonstrated above.
The last patch avoids new cpp macro redefinition warnings.
Now that we're using a few more gnulib modules, they
end up defining _GNU_SOURCE via a definition in config.h,
so the explicit definitons in various *.c files evoke warnings.
$ wc -l 00*
45 0001-build-avoid-some-autoconf-warnings.patch
353 0002-guestfish-write-help-to-stdout-use-gnulib-s-progname.patch
27 0003-guestfish-don-t-try-to-diagnose-getopt-failure.patch
53 0004-guestfish-diagnose-stdout-write-failure.patch
88 0005-build-don-t-define-_GNU_SOURCE-manually.patch
566 total
$ diffstat 00*
b/bootstrap | 1
b/configure.ac | 11 ++--
b/fish/Makefile.am | 3 -
b/fish/destpaths.c | 2
b/fish/fish.c | 125 ++++++++++++++++++++++++++++++++++-------------------
b/src/guestfs.c | 2
bootstrap | 8 ++-
fish/fish.c | 9 +--
8 files changed, 100 insertions(+), 61 deletions(-)
15 years, 2 months
enable -Werror and all of gcc's warning options
by Jim Meyering
Here is a bunch of small patches to make fish/ build
with most warnings enabled:
[1/9] edit.c: avoid warning about signed/unsigned comparison
[2/9] fish.c: avoid warnings
[3/9] tilde.c: avoid a warning
[4/9] fish.c: avoid "assignment discards qualifiers..." warning
[5/9] fish.c: avoid signed/unsigned-comparison warning
[6/9] fish.c: don't perform arithmetic on void* pointers
[7/9] destpaths.c: avoid signed/unsigned-comparison warning
[8/9] generator.ml: avoid signed/unsigned-comparison warning in fish/cmds.c
[9/9] fish/: enable -Werror and all of gcc's warning options
b/fish/Makefile.am | 5 ++---
b/fish/destpaths.c | 3 +--
b/fish/edit.c | 6 +++---
b/fish/fish.c | 2 +-
b/fish/fish.h | 2 +-
b/fish/rc.c | 3 ---
b/fish/tilde.c | 9 +++------
b/src/generator.ml | 5 ++---
fish/fish.c | 9 ++++-----
fish/fish.h | 7 ++++++-
10 files changed, 23 insertions(+), 28 deletions(-)
15 years, 2 months
[virt-v2v] "make distcheck" now passes
by Jim Meyering
There were a few "infelicities" that kept the "make distcheck"
test from passing. These three patches combine to fix all of them,
punting on only one by disabling the install-data-hook rule.
>From 7504acedcb71bd80d99abe412e6669b267cade38 Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering(a)redhat.com>
Date: Fri, 21 Aug 2009 13:37:18 +0200
Subject: [PATCH 1/3] build: use newer gettext files
* configure.ac: Use gettext 0.15, not 0.14.
---
configure.ac | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/configure.ac b/configure.ac
index 3e057d7..204bfb6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -54,7 +54,7 @@ test "x$MKISOFS" = "xno" && AC_MSG_ERROR([mkisofs must be installed])
dnl For i18n.
AM_GNU_GETTEXT([external])
-AM_GNU_GETTEXT_VERSION([0.14])
+AM_GNU_GETTEXT_VERSION([0.15])
dnl Check for Perl
AC_CHECK_PROG([PERL],[perl],[perl],[no])
--
1.6.4.378.g88f2f
>From b077a19ae444aadfe8baf5d29df7125394b1a867 Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering(a)redhat.com>
Date: Fri, 21 Aug 2009 13:32:03 +0200
Subject: [PATCH 2/3] configure.ac: correct typo in package name
* configure.ac (PACKAGE_NAME): It's virt-v2v, not virtv2v.
---
configure.ac | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/configure.ac b/configure.ac
index 204bfb6..9acc430 100644
--- a/configure.ac
+++ b/configure.ac
@@ -22,7 +22,7 @@ m4_define([virtv2v_release], [68])
# extra can be any string
m4_define([virtv2v_extra], [])
-AC_INIT([virtv2v],virtv2v_major.virtv2v_minor.virtv2v_release[]virtv2v_extra)
+AC_INIT([virt-v2v],virtv2v_major.virtv2v_minor.virtv2v_release[]virtv2v_extra)
AC_CONFIG_AUX_DIR([build-aux])
AM_INIT_AUTOMAKE([foreign])
--
1.6.4.378.g88f2f
>From 2e33faf68770703d832f693528229dc3676ecace Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering(a)redhat.com>
Date: Fri, 21 Aug 2009 12:45:46 +0200
Subject: [PATCH 3/3] build: arrange for "make distcheck" to pass
* perl/Makefile.am (install-data-hook): Remove rule, for now.
(clean-local): Use perl's "realclean" target, not "clean".
The latter would fail to remove Makefile-pl.old.
* Makefile.am (CLEANFILES): Define, to clean up after pod2html.
* v2v/Makefile.am (CLEANFILES): Define, so that "make clean"
removes generated *.1 files.
* v2v/Makefile.am (virt-v2v.1): Don't redirect directly to $@.
*** empty log message ***
---
Makefile.am | 2 ++
perl/Makefile.am | 7 ++++---
v2v/Makefile.am | 4 +++-
3 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/Makefile.am b/Makefile.am
index 4e75eb0..9e2918b 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -18,3 +18,5 @@
ACLOCAL_AMFLAGS = -I m4
SUBDIRS = perl po v2v
+
+CLEANFILES = pod2htmd.tmp pod2htmi.tmp html/$(PACKAGE_NAME).1.html
diff --git a/perl/Makefile.am b/perl/Makefile.am
index f0d73f1..414abdb 100644
--- a/perl/Makefile.am
+++ b/perl/Makefile.am
@@ -33,8 +33,9 @@ Makefile-pl: Makefile.PL
#CLEANFILES = Makefile-pl
clean-local:
- -$(MAKE) -f Makefile-pl clean
+ -$(MAKE) -f Makefile-pl realclean
rm -f Makefile-pl
-install-data-hook:
- $(MAKE) -f Makefile-pl DESTDIR=$(DESTDIR) install
+# Don't do this: it causes "make distcheck" to fail.
+#install-data-hook:
+# $(MAKE) -f Makefile-pl DESTDIR=$(DESTDIR) install
diff --git a/v2v/Makefile.am b/v2v/Makefile.am
index 49dac50..5030742 100644
--- a/v2v/Makefile.am
+++ b/v2v/Makefile.am
@@ -20,15 +20,17 @@ EXTRA_DIST = \
virt-v2v.pl
man_MANS = virt-v2v.1
+CLEANFILES = $(man_MANS)
noinst_DATA = @top_builddir(a)/html/virt-v2v.1.html
virt-v2v.1: virt-v2v.pl
+ rm -f $@-t $@
$(POD2MAN) \
--section 1 \
-c "Virtualization Support" \
--release "$(PACKAGE_NAME)-$(PACKAGE_VERSION)" \
- $< > $@
+ $< > $@-t && mv $@-t $@
@top_builddir(a)/html/virt-v2v.1.html: virt-v2v.pl
mkdir -p @top_builddir@/html
--
1.6.4.378.g88f2f
15 years, 2 months