summaryrefslogtreecommitdiff
path: root/build-aux/announce-gen
diff options
context:
space:
mode:
authorJim Meyering <meyering@fb.com>2022-07-09 18:42:29 -0700
committerJim Meyering <meyering@fb.com>2022-07-09 18:52:10 -0700
commitde5867755e668ee4d725aecf30922adcf9d5f93a (patch)
treefd1ff26ab96de6e91a82ec6321b8f0a21338431f /build-aux/announce-gen
parentbe1b6d4bfaf1ad73780f30d6cd12cae3633b816a (diff)
downloadgnulib-de5867755e668ee4d725aecf30922adcf9d5f93a.tar.gz
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
Diffstat (limited to 'build-aux/announce-gen')
-rwxr-xr-xbuild-aux/announce-gen8
1 files changed, 6 insertions, 2 deletions
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;