[Libvir] [PATCH] Enable 'make syntax-check's sc_changelog rule.

I went ahead and wrote the change: Enable 'make syntax-check's sc_changelog rule. * Makefile.maint (sc_changelog): Adapt to work with legacy ChangeLog entry header lines. * Makefile.cfg (local-checks-to-skip): Remove sc_changelog. --- Makefile.cfg | 1 - Makefile.maint | 6 +++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Makefile.cfg b/Makefile.cfg index 7e8ddcf..e0d5528 100644 --- a/Makefile.cfg +++ b/Makefile.cfg @@ -32,7 +32,6 @@ local-checks-to-skip = \ sc_GPL_version \ sc_always_defined_macros \ sc_cast_of_alloca_return_value \ - sc_changelog \ sc_dd_max_sym_length \ sc_error_exit_success \ sc_file_system \ diff --git a/Makefile.maint b/Makefile.maint index a357d74..65d6fc2 100644 --- a/Makefile.maint +++ b/Makefile.maint @@ -166,8 +166,12 @@ sc_obsolete_symbols: # FIXME: warn about definitions of EXIT_FAILURE, EXIT_SUCCESS, STREQ # Each nonempty line must start with a year number, or a TAB. +# Or day-of-week+space. +changelog_entry_header_regexp = \ + ([12][0-9][0-9][0-9]| .|(Mon|Tue|Wed|Thu|Fri|Sat|Sun) ) sc_changelog: - @grep -n '^[^12 ]' $$(find . -maxdepth 2 -name ChangeLog) && \ + @grep -Evn '(^$$|^$(changelog_entry_header_regexp))' \ + $$(find . -maxdepth 2 -name ChangeLog) && \ { echo '$(ME): found unexpected prefix in a ChangeLog' 1>&2; \ exit 1; } || : -- 1.5.5.rc2.7.g144a

On Thu, Apr 10, 2008 at 11:10:05AM +0200, Jim Meyering wrote:
I went ahead and wrote the change:
Enable 'make syntax-check's sc_changelog rule. * Makefile.maint (sc_changelog): Adapt to work with legacy ChangeLog entry header lines. * Makefile.cfg (local-checks-to-skip): Remove sc_changelog.
# Each nonempty line must start with a year number, or a TAB. +# Or day-of-week+space. +changelog_entry_header_regexp = \ + ([12][0-9][0-9][0-9]| .|(Mon|Tue|Wed|Thu|Fri|Sat|Sun) ) sc_changelog: - @grep -n '^[^12 ]' $$(find . -maxdepth 2 -name ChangeLog) && \ + @grep -Evn '(^$$|^$(changelog_entry_header_regexp))' \ + $$(find . -maxdepth 2 -name ChangeLog) && \ { echo '$(ME): found unexpected prefix in a ChangeLog' 1>&2; \ exit 1; } || :
Yes, it looks OK to me. +1 Y3K bug? Rich. -- Richard Jones, Emerging Technologies, Red Hat http://et.redhat.com/~rjones virt-p2v converts physical machines to virtual machines. Boot with a live CD or over the network (PXE) and turn machines into Xen guests. http://et.redhat.com/~rjones/virt-p2v

"Richard W.M. Jones" <rjones@redhat.com> wrote:
On Thu, Apr 10, 2008 at 11:10:05AM +0200, Jim Meyering wrote:
I went ahead and wrote the change:
Enable 'make syntax-check's sc_changelog rule. * Makefile.maint (sc_changelog): Adapt to work with legacy ChangeLog entry header lines. * Makefile.cfg (local-checks-to-skip): Remove sc_changelog.
# Each nonempty line must start with a year number, or a TAB. +# Or day-of-week+space. +changelog_entry_header_regexp = \ + ([12][0-9][0-9][0-9]| .|(Mon|Tue|Wed|Thu|Fri|Sat|Sun) ) sc_changelog: - @grep -n '^[^12 ]' $$(find . -maxdepth 2 -name ChangeLog) && \ + @grep -Evn '(^$$|^$(changelog_entry_header_regexp))' \ + $$(find . -maxdepth 2 -name ChangeLog) && \ { echo '$(ME): found unexpected prefix in a ChangeLog' 1>&2; \ exit 1; } || :
Yes, it looks OK to me.
+1
Y3K bug?
Yep. That was deliberate ;-) I'd rather be a little more strict. Who knows... it might even catch typos with transposed initial digits.
participants (2)
-
Jim Meyering
-
Richard W.M. Jones