From ace5387fb6409b6ad773a43f3d1ef6dd922295c6 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Wed, 13 Feb 2008 14:33:02 +0100 Subject: Ensure that dircolors.c and ls.c remain in sync. * Makefile.am (check-ls-dircolors): New rule. (distcheck-hook): Depend on it. --- Makefile.am | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'Makefile.am') 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" -- cgit v1.2.3-54-g00ecf