]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
maint: add syntax-check to ensure all gl/ files are distributed
authorPádraig Brady <P@draigBrady.com>
Mon, 14 Oct 2024 12:06:44 +0000 (13:06 +0100)
committerPádraig Brady <P@draigBrady.com>
Mon, 14 Oct 2024 12:12:03 +0000 (13:12 +0100)
* cfg.mk (sc_gldist_missing): Add a new target to ensure we don't
forget to distribute any new gl/ files.
* gl/local.mk: Remove generation comment since it's
now encapsulated in the syntax-check, which outputs a consumable
diff to make any future adjustments.
Also adjust ordering to that of the C locale used in the syntax check.

cfg.mk
gl/local.mk

diff --git a/cfg.mk b/cfg.mk
index 1ce5d17f9dfcbe0ddb096e118465ca95d88c8889..70b5a262036dd58b70a1e21e92ef5f4fd69540b5 100644 (file)
--- a/cfg.mk
+++ b/cfg.mk
@@ -819,6 +819,21 @@ sc_gitignore_missing:
 #          sort | uniq -d | grep . && { echo '$(ME): Remove above'     \
 #            'entries from .gitignore' >&2; exit 1; } || :
 
+# Ensure gl/ files are distributed
+sc_gldist_missing:
+       @cd $(srcdir);                                                  \
+       grep '^gl/' gl/local.mk > $@.a;                                 \
+       find gl '(' -name Makefile.am ')' -prune -o -type f             \
+               '!' '(' -name '*.orig' -or -name '*~' -or               \
+                       -name 'ChangeLog.*' ')' -printf '%p\n' |        \
+       LC_ALL=C sort | tr '\012' @ | sed 's/@$$/%/;s/@/ \\@/g' |       \
+       tr @% '\012\012' > $@.e;                                        \
+       diff -u $@.a $@.e; diff=$$?;                                    \
+       rm -f $@.a $@.e;                                                \
+       test "$$diff" = 0                                               \
+         || { echo '$(ME): Inconsistent EXTRA_DIST in gl/local.mk'>&2; \
+              exit 1; }
+
 sc_prohibit-form-feed:
        @prohibit=$$'\f' \
        in_vc_files='\.[chly]$$' \
index 85b8e2b9e674f8d3ff44a77686f2512a095c43b3..34a90def6774adbb256ba8ebe060193c71a7a507 100644 (file)
@@ -1,7 +1,7 @@
 # Make coreutils programs.                             -*-Makefile-*-
 # This is included by the top-level Makefile.am.
 
-## Copyright (C) 2006-2024 Free Software Foundation, Inc.
+## Copyright (C) 2024 Free Software Foundation, Inc.
 
 ## This program is free software: you can redistribute it and/or modify
 ## it under the terms of the GNU General Public License as published by
@@ -16,8 +16,6 @@
 ## You should have received a copy of the GNU General Public License
 ## along with this program.  If not, see <https://www.gnu.org/licenses/>.
 
-# Generate this list with
-# find gl '(' -name Makefile.am ')' -prune -o -type f '!' '(' -name '*.orig' -or -name '*~' -or -name 'ChangeLog.*' ')' -printf '%p\n' | sort | tr '\012' @ | sed 's/@$/%/;s/@/ \\@/g' | tr @% '\012\012'
 EXTRA_DIST += \
 gl/lib/buffer-lcm.c \
 gl/lib/buffer-lcm.h \
@@ -30,10 +28,10 @@ gl/lib/fd-reopen.c \
 gl/lib/fd-reopen.h \
 gl/lib/heap.c \
 gl/lib/heap.h \
-gl/lib/randint.c \
-gl/lib/randint.h \
 gl/lib/rand-isaac.c \
 gl/lib/rand-isaac.h \
+gl/lib/randint.c \
+gl/lib/randint.h \
 gl/lib/randperm.c \
 gl/lib/randperm.h \
 gl/lib/randread.c \
@@ -44,9 +42,9 @@ gl/lib/skipchars.c \
 gl/lib/skipchars.h \
 gl/lib/smack.h \
 gl/lib/strintcmp.c \
+gl/lib/strnumcmp-in.h \
 gl/lib/strnumcmp.c \
 gl/lib/strnumcmp.h \
-gl/lib/strnumcmp-in.h \
 gl/lib/targetdir.c \
 gl/lib/targetdir.h \
 gl/lib/xdectoimax.c \