[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] maint: use a wildcard to include all syntax check exceptions
From: |
Jim Meyering |
Subject: |
Re: [PATCH] maint: use a wildcard to include all syntax check exceptions in dist |
Date: |
Mon, 08 Jun 2009 12:09:56 +0200 |
Pádraig Brady wrote:
> Jim Meyering wrote:
>> Pádraig Brady wrote:
>>> I noticed a couple of syntax check exception files
>>> missing from the distribution tarball. Specifically
>>> .x-sc_require_config_h_first and .x-sc_error_message_uppercase
>>>
>>> The attached patch changes things so we don't have to
>>> maintain the list.
>>
>> Good catch.
>> I've suspected there were a few like that, but
>> didn't really care, since it's not very useful to run
>> "make syntax-check" from an unpacked-tarball directory.
>>
>> However, using a wildcard there would violate a pretty important rule:
>>
>> - don't distribute wildcard-selected file names
>>
>> Otherwise, you can accidentally distribute .x-sc_foo~,
>> or .x-sc_some-experimental-or-rejected-change
>>
>> I haven't looked closely enough to say yet, but
>> consider two alternatives:
>>
>> - stop distributing those .x-sc_ files altogether, or
>>
>> - add a check to ensure that all version-controlled
>> .x-sc_ names are in that list
>
> Attached is a new syntax-check rule to ensure the list for
> distribution stays in sync with the repository.
Thanks!
...
> + test "$$(($(VC_LIST) | sed -n '/^.x-sc_/p'; \
> + sed -n "/^$$sce =[ ]*\\\\$$/,/[^\]$$/p" \
> + $(srcdir)/Makefile.am \
> + | sed "s/^ *//;/^$$sce =/d" \
> + | tr -s '\012\\' ' ' | fmt -1 \
> + ) | sort | uniq -u)" \
> + && { echo "Makefile.am: $$sce mismatch" >&2; exit 1; } \
> + || :;
Quoting infelicity.
Notice how the second sed expression is not quoted at all.
How about this instead?
>From cd85393dd242131de202e5a34463010bb6d40815 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?P=C3=A1draig=20Brady?= <address@hidden>
Date: Mon, 8 Jun 2009 08:42:00 +0100
Subject: [PATCH] maint: Add a syntax-check to ensure all .x-sc_ files are
distributed
* Makefile.am: Add a couple of missing entries to
syntax_check_exceptions for distribution.
* cfg.mk: Add a rule to ensure the syntax_check_exceptions variable
stays in sync with the .x-sc_* files in the repository.
---
Makefile.am | 2 ++
cfg.mk | 11 +++++++++++
2 files changed, 13 insertions(+), 0 deletions(-)
diff --git a/Makefile.am b/Makefile.am
index 7670cd6..97be46a 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -40,6 +40,7 @@ changelog_etc = \
syntax_check_exceptions = \
.x-sc_GPL_version \
+ .x-sc_error_message_uppercase \
.x-sc_file_system \
.x-sc_obsolete_symbols \
.x-sc_po_check \
@@ -48,6 +49,7 @@ syntax_check_exceptions = \
.x-sc_prohibit_stat_st_blocks \
.x-sc_prohibit_strcmp \
.x-sc_require_config_h \
+ .x-sc_require_config_h_first \
.x-sc_space_tab \
.x-sc_sun_os_names \
.x-sc_trailing_blank \
diff --git a/cfg.mk b/cfg.mk
index 393d4cb..861595f 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -99,6 +99,17 @@ sc_root_tests:
exit 1; } || :; \
fi
+sce = syntax_check_exceptions
+sc_x_sc_dist_check:
+ @test "$$(($(VC_LIST) | sed -n '/^.x-sc_/p'; \
+ sed -n '/^$(sce) =[ ]*\\$$/,/[^\]$$/p' \
+ $(srcdir)/Makefile.am \
+ | sed 's/^ *//;/^$(sce) =/d' \
+ | tr -s '\012\\' ' ' | fmt -1 \
+ ) | sort | uniq -u)" \
+ && { echo "Makefile.am: $(sce) mismatch" >&2; exit 1; } \
+ || :;
+
headers_with_interesting_macro_defs = \
exit.h \
fcntl_.h \
--
1.6.3.2.322.g117de