summaryrefslogtreecommitdiff
path: root/Makefile.am
diff options
context:
space:
mode:
authorJim Meyering <meyering@redhat.com>2008-02-13 14:33:02 +0100
committerJim Meyering <meyering@redhat.com>2008-02-17 11:16:18 +0100
commitace5387fb6409b6ad773a43f3d1ef6dd922295c6 (patch)
tree421fc03fa6b55af675c2aac41c7ee285156d25c3 /Makefile.am
parentbbb82c231a255aee71a8c7f4263bb5859ab0c47a (diff)
downloadcoreutils-ace5387fb6409b6ad773a43f3d1ef6dd922295c6.tar.xz
Ensure that dircolors.c and ls.c remain in sync.
* Makefile.am (check-ls-dircolors): New rule. (distcheck-hook): Depend on it.
Diffstat (limited to 'Makefile.am')
-rw-r--r--Makefile.am14
1 files changed, 13 insertions, 1 deletions
diff --git a/Makefile.am b/Makefile.am
index a7083be31..fcf5cfaf7 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -91,7 +91,7 @@ gen-ChangeLog:
mv $(distdir)/cl-t $(distdir)/ChangeLog; \
fi
-distcheck-hook:
+distcheck-hook: check-ls-dircolors
$(MAKE) my-distcheck
DISTCLEANFILES = VERSION
@@ -103,3 +103,15 @@ THANKS-to-translators: po/LINGUAS THANKStt.in
echo http://www.iro.umontreal.ca/contrib/po/HTML/team-$$lang.html; \
done; \
) > $@-tmp && mv $@-tmp $@
+
+# Ensure that the sets of two-letter codes in ls.c and dircolors.c
+# remain in sync.
+.PHONY: check-ls-dircolors
+check-ls-dircolors:
+ dc=$$(sed -n '/static.*ls_codes\[/,/};'/p src/dircolors.c \
+ |sed -n '/^ *"/p'|tr , '\n'|sed 's/^ *//' \
+ |sed -n 's/^"\(..\)"/\1/p'|sort -u); \
+ ls=$$(sed -n '/static.*indicator_name\[/,/};'/p src/ls.c \
+ |sed -n '/^ *"/p'|tr , '\n'|sed 's/^ *//' \
+ |sed -n 's/^"\(..\)"/\1/p'|sort -u); \
+ test "$$dc" = "$$ls"