From de5867755e668ee4d725aecf30922adcf9d5f93a Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Sat, 9 Jul 2022 18:42:29 -0700 Subject: announce-gen: better diagnose some usage errors * build-aux/announce-gen (main): Erroneous usage would elicit a misleading diagnostic. When --gnulib-version=V was specified: - without --bootstrap-tools=..., or - with --bootstrap-tools=..., but without "gnulib" in that list we would give an inappropriate diagnostic. Now, each diagnostic is tailored to the precise erroneous condition. Reported by Bruno Haible in https://lists.gnu.org/r/bug-gnulib/2022-01/msg00025.html --- build-aux/announce-gen | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'build-aux/announce-gen') diff --git a/build-aux/announce-gen b/build-aux/announce-gen index 3557fabf4b..320cf4b0d6 100755 --- a/build-aux/announce-gen +++ b/build-aux/announce-gen @@ -35,7 +35,7 @@ eval 'exec perl -wSx "$0" "$@"' if 0; -my $VERSION = '2022-07-08 22:28'; # UTC +my $VERSION = '2022-07-10 01:47'; # UTC # The definition above must lie within the first 8 lines in order # for the Emacs time-stamp write hook (at end) to update it. # If you change this file with Emacs, please let the write hook @@ -445,11 +445,15 @@ sub get_tool_versions ($$) my @tool_list = split ',', $bootstrap_tools if $bootstrap_tools; - grep (/^gnulib$/, @tool_list) ^ defined $gnulib_version + grep (/^gnulib$/, @tool_list) && ! defined $gnulib_version and (warn "when specifying gnulib as a tool, you must also specify\n" . "--gnulib-version=V, where V is the result of running git describe\n" . "in the gnulib source directory.\n"), $fail = 1; + ! grep (/^gnulib$/, @tool_list) && defined $gnulib_version + and (warn "with --gnulib-version=V you must use --bootstrap-tools=...\n" + . "including gnulib in that list"), $fail = 1; + !$release_type || exists $valid_release_types{$release_type} or (warn "'$release_type': invalid release type\n"), $fail = 1; -- cgit v1.2.1