Pino Toscano
2015-Sep-08 09:53 UTC
[Libguestfs] [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 8f0bb1b..f4916a1 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. -- 2.1.0
Richard W.M. Jones
2015-Sep-08 11:31 UTC
Re: [Libguestfs] [PATCH] build: improve maintainer-check-extra-dist target
On Tue, Sep 08, 2015 at 11:53:43AM +0200, Pino Toscano wrote:> 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 8f0bb1b..f4916a1 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.ACK. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com libguestfs lets you edit virtual machines. Supports shell scripting, bindings from many languages. http://libguestfs.org
Possibly Parallel Threads
- [PATCH 4/3] build: exclude common/mlv2v from distcheck
- [LLVMdev] Shouldn't tools and projects in .gitignore go to .gitmodules?
- intltool error on latest git
- [v2v PATCH 5/3] build: exclude common/windows from distcheck
- [v2v PATCH v2 0/5] Various build cleanups