2022-06-03 Paul Eggert <eggert@cs.ucla.edu>
+ regex-quote: \] -> ] in EREs and BREs
+ * build-aux/bootstrap:
+ * build-aux/bootstrap.conf (gettext_external):
+ * check-AC_LIBOBJ:
+ * lib/regex-quote.c (bre_special, ere_special):
+ * gnulib-tool (func_modules_transitive_closure)
+ (func_emit_autoconf_snippet, func_import, func_create_testdir):
+ * tests/test-regex-quote.c (test_bre, test_ere):
+ * top/maint.mk (longopt_re, gpg_key_ID):
+ Don’t use \] in BREs and EREs, as POSIX says the interpretation is
+ undefined.
+
filevercmp: don’t treat entire filename as suffix
Problem reported by Artém S. Tashkinóv in:
https://lists.gnu.org/r/bug-gnulib/2022-06/msg00012.html
#! /bin/sh
# Print a version string.
-scriptversion=2022-03-21.01; # UTC
+scriptversion=2022-06-04.00; # UTC
# Bootstrap this package from checked-out sources.
# Die if there is no AC_CONFIG_AUX_DIR($build_aux) line in configure.ac.
found_aux_dir=no
-grep '^[ ]*AC_CONFIG_AUX_DIR(\['"$build_aux"'\])' configure.ac \
+grep '^[ ]*AC_CONFIG_AUX_DIR(\['"$build_aux"'])' configure.ac \
>/dev/null && found_aux_dir=yes
grep '^[ ]*AC_CONFIG_AUX_DIR('"$build_aux"')' configure.ac \
>/dev/null && found_aux_dir=yes
gettext_external=0
grep '^[ ]*AM_GNU_GETTEXT(external\>' configure.ac > /dev/null &&
gettext_external=1
-grep '^[ ]*AM_GNU_GETTEXT(\[external\]' configure.ac > /dev/null &&
+grep '^[ ]*AM_GNU_GETTEXT(\[external]' configure.ac > /dev/null &&
gettext_external=1
if test $gettext_external = 1; then
exitcode=0
for module in `./gnulib-tool --list`; do
f=modules/$module
- for g in `sed -n -e 's/^ *AC_LIBOBJ(\[\(.*\)\]).*/\1/p' < $f`; do
+ for g in `sed -n -e 's/^ *AC_LIBOBJ(\[\(.*\)]).*/\1/p' < $f`; do
if grep "^lib/$g\.c\$" $f >/dev/null; then
:
else
sed_extract_condition1='/^ *'"$escaped_dep"' *$/{
s/^.*$/true/p
}'
- sed_extract_condition2='/^ *'"$escaped_dep"' *\[.*\] *$/{
- s/^ *'"$escaped_dep"' *\[\(.*\)\] *$/\1/p
+ sed_extract_condition2='/^ *'"$escaped_dep"' *\[.*] *$/{
+ s/^ *'"$escaped_dep"' *\[\(.*\)] *$/\1/p
}'
condition=`func_get_dependencies $module | sed -n -e "$sed_extract_condition1" -e "$sed_extract_condition2"`
if test "$condition" = true; then
fi
} \
| { if $disable_gettext; then
- sed -e 's/AM_GNU_GETTEXT(\[external\])/dnl you must add AM_GNU_GETTEXT([external]) or similar to configure.ac./'
+ sed -e 's/AM_GNU_GETTEXT(\[external])/dnl you must add AM_GNU_GETTEXT([external]) or similar to configure.ac./'
else
# Don't indent AM_GNU_GETTEXT_VERSION line, as that confuses
# autopoint through at least GNU gettext version 0.18.2.
s,#.*$,,
s,^dnl .*$,,
s, dnl .*$,,
- /AC_DEFUN(\['"${cached_macro_prefix}"'_FILE_LIST\], \[/ {
+ /AC_DEFUN(\['"${cached_macro_prefix}"'_FILE_LIST], \[/ {
s,^.*$,cached_files=",p
n
ta
:a
- s,^\]).*$,",
+ s,^]).*$,",
tb
s,["$`\\],,g
p
esac
fi
done \
- | sed -e '/^$/d;' -e 's/AC_REQUIRE(\[\([^()]*\)\])/\1/'
+ | sed -e '/^$/d;' -e 's/AC_REQUIRE(\[\([^()]*\)])/\1/'
if test "$libtool" = true; then
echo "LT_INIT([win32-dll])"
echo "LT_LANG([C++])"
func_get_autoconf_early_snippet "$module"
fi
done \
- | sed -e '/^$/d;' -e 's/AC_REQUIRE(\[\([^()]*\)\])/\1/'
+ | sed -e '/^$/d;' -e 's/AC_REQUIRE(\[\([^()]*\)])/\1/'
if test "$libtool" = true; then
echo "LT_INIT([win32-dll])"
echo "LT_LANG([C++])"
#include "xalloc.h"
/* Characters that are special in a BRE. */
-static const char bre_special[] = "$^.*[]\\";
+static const char bre_special[] = "$^.*[\\";
/* Characters that are special in an ERE. */
-static const char ere_special[] = "$^.*[]\\+?{}()|";
+static const char ere_special[] = "$^.*[\\+?{}()|";
struct regex_quote_spec
regex_quote_spec_posix (int cflags, bool anchored)
test_bre (void)
{
check ("aBc", 0, "aBc");
- check ("(foo[$HOME])", 0, "(foo\\[\\$HOME\\])");
+ check ("(foo[$HOME])", 0, "(foo\\[\\$HOME])");
}
static void
test_ere (void)
{
check ("aBc", REG_EXTENDED, "aBc");
- check ("(foo[$HOME])", REG_EXTENDED, "\\(foo\\[\\$HOME\\]\\)");
+ check ("(foo[$HOME])", REG_EXTENDED, "\\(foo\\[\\$HOME]\\)");
}
int
# Match lines like the following, but where there is only one space
# between the options and the description:
# -D, --all-repeated[=delimit-method] print all duplicate lines\n
-longopt_re = --[a-z][0-9A-Za-z-]*(\[?=[0-9A-Za-z-]*\]?)?
+longopt_re = --[a-z][0-9A-Za-z-]*(\[?=[0-9A-Za-z-]*]?)?
sc_two_space_separator_in_usage:
@prohibit='^ *(-[A-Za-z],)? $(longopt_re) [^ ].*\\$$' \
halt='help2man requires at least two spaces between an option and its description'\
$$(cd $(srcdir) \
&& git cat-file tag v$(VERSION) \
| $(gpgv) --status-fd 1 --keyring /dev/null - - 2>/dev/null \
- | $(AWK) '/^\[GNUPG:\] ERRSIG / {print $$3; exit}')
+ | $(AWK) '/^\[GNUPG:] ERRSIG / {print $$3; exit}')
gpg_key_email ?= \
$$(gpg --list-key --with-colons $(gpg_key_ID) 2>/dev/null \
| $(AWK) -F: '/^uid/ {print $$10; exit}' \
# a macro like this: GLOBAL(type, var_name, initializer), then you
# can override this definition to automatically extract those names:
# export _gl_TS_var_match = \
-# /^(?:$(_gl_TS_extern)) .*?\**(\w+)(\[.*?\])?;/ || /\bGLOBAL\(.*?,\s*(.*?),/
-_gl_TS_var_match ?= /^(?:$(_gl_TS_extern)) .*?(\w+)(\[.*?\])?;/
+# /^(?:$(_gl_TS_extern)) .*?\**(\w+)(\[.*?])?;/ || /\bGLOBAL\(.*?,\s*(.*?),/
+_gl_TS_var_match ?= /^(?:$(_gl_TS_extern)) .*?(\w+)(\[.*?])?;/
# The names of object files in (or relative to) $(_gl_TS_dir).
_gl_TS_obj_files ?= *.$(OBJEXT)