From 6d08da07dc31c620342b028892497c13c6e65876 Mon Sep 17 00:00:00 2001 From: Pino Toscano Date: Tue, 8 Sep 2015 11:52:44 +0200 Subject: [PATCH] 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). --- Makefile.am | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/Makefile.am b/Makefile.am index 8f0bb1bb9..f4916a142 100644 --- a/Makefile.am +++ b/Makefile.am @@ -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.