groups: added `make check'

This one has became direly needed while reworking
Centaurus' pkglists/groups into a tree.
This commit is contained in:
Michael Shigorin 2016-04-15 18:22:06 +03:00
parent 4c2ff13085
commit eae7b38cc0

View File

@ -2,8 +2,35 @@
# (and only those!) over to $(BUILDDIR)
ifndef BUILDDIR
$(error BUILDDIR not defined)
endif
check all: check-parents check-echo check-pkglists; @:
check-parents:
@find -name "*.directory" \
| xargs -r -- sed -rn 's,^X-Alterator-Parent=(.*)$$,\1,p' \
| sort -u \
| while read group; do \
if ! [ -f "$$group.directory" ]; then \
echo "** Error: missing parent group referenced in:"; \
grep -rl "=$$group$$" $$(find -name "*.directory"); \
fi >&2; \
done
check-echo:
@echo
check-pkglists:
@find -name "*.directory" \
| xargs -r -- sed -rn 's,^X-Alterator-PackageList=(.*)$$,\1,p' \
| sort -u \
| while read list; do \
if ! [ -f "../lists/$$list" ]; then \
echo "** Error: missing pkglist referenced in:"; \
grep -rl "=$$list$$" $$(find -name "*.directory"); \
fi >&2; \
done
else
include $(BUILDDIR)/distcfg.mk
SUFFIX := pkg/groups
@ -20,3 +47,5 @@ all: $(GLOBAL_DEBUG)
debug:
@echo "** THE_GROUPS: $(THE_GROUPS)"
@echo "** MAIN_GROUPS: $(MAIN_GROUPS)"
endif