[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] maint: update tests/init.sh from gnulib
From: |
Jim Meyering |
Subject: |
Re: [PATCH] maint: update tests/init.sh from gnulib |
Date: |
Wed, 22 Dec 2021 09:15:36 -0800 |
On Mon, Dec 20, 2021 at 2:31 PM Bernhard Voelker
<mail@bernhard-voelker.de> wrote:
> Patch attached.
>
> Additionally, it may be worth adding a syntax-check rule to ensure the files
> physically copied from gnulib stay in sync.
> WDYT?
>
> Have a nice day,
> Berny
>
> diff --git a/cfg.mk b/cfg.mk
> index 6d6c37dc2..f06223f2e 100644
> --- a/cfg.mk
> +++ b/cfg.mk
> @@ -138,6 +138,14 @@ sc_ensure_gl_diffs_apply_cleanly:
> 'make refresh-gnulib-patches' >&2; exit 1; } \
> done
>
> +# Ensure all physically copied files from gnulib are in sync
> +sc_ensure_copied_gnulib_files_are_in_sync:
> + @diff -u $(srcdir)/gnulib/doc/COPYINGv3 $(srcdir)/COPYING \
> + && diff -u $(srcdir)/gnulib/build-aux/bootstrap $(srcdir)/bootstrap
> \
> + && diff -u $(srcdir)/gnulib/tests/init.sh $(srcdir)/tests/init.sh \
> + || { echo '$(ME): please update copied files from gnulib' 1>&2; \
> + exit 1; }\
> +
> # Avoid :>file which doesn't propagate errors
> sc_prohibit_colon_redirection:
> @cd $(srcdir)/tests && GIT_PAGER= git grep -En ': *>.*\|\|' \
Thanks. Please push.
I like the idea of adding a syntax-check rule for that, too. Long overdue.
However, what do you think about making it work also for projects like sed
for which init.sh is in a differently-named subdir (there, it's "testsuite/")?
Then, we could consider moving it to maint.mk.
Technically, we could run "git ls-files" and search for '/init\.sh$', but
simplest might be to just add a variable whose default value is "tests"
and may be overridden. If someone has two or more init.sh files (or none),
then searching via git ls-files may make more sense.