build: improve maintainer-check-extra-dist target

Filter out from the git ls-files output the files we don't care they
appeared (gnulib and intltools stuff), and use comm to only show the
remaining added files (i.e. files not being distributed).

The output of comm is redirected to file and then printed, so we can
check it is empty (failing the target if not).
This commit is contained in:
Pino Toscano
2015-09-08 11:52:44 +02:00
parent fb9c17c8d4
commit 6d08da07dc

View File

@@ -573,13 +573,15 @@ maintainer-tag:
maintainer-check-extra-dist:
zcat $(PACKAGE_NAME)-$(VERSION).tar.gz | tar tf - | sort | \
sed 's,^$(PACKAGE_NAME)-$(VERSION)/,,' > tmp/tarfiles
git ls-files | sort > tmp/gitfiles
diff -ur tmp/tarfiles tmp/gitfiles | \
grep '^\+' | \
grep -v '^\+intltool-.*\.in' | \
grep -v '^\+.gitmodules' | \
grep -v '^\+.gnulib' ||:
rm tmp/tarfiles tmp/gitfiles
git ls-files | \
grep -v '^intltool-.*\.in' | \
grep -v '^\.gitmodules' | \
grep -v '^\.gnulib' | \
sort > tmp/gitfiles
comm -13 tmp/tarfiles tmp/gitfiles > tmp/comm-out
cat tmp/comm-out
[ ! -s tmp/comm-out ]
rm tmp/tarfiles tmp/gitfiles tmp/comm-out
# Provide help on common Makefile targets.