chiark / gitweb /
bin/mdw-build: Fetch `distdir' more robustly.
authorMark Wooding <mdw@distorted.org.uk>
Wed, 5 Jun 2013 19:54:17 +0000 (20:54 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Tue, 17 Dec 2013 18:35:46 +0000 (18:35 +0000)
Some build scripts will try to build something before they can properly
answer the `print-distdir' question.  Avoid being confused by the
resulting spam by writing the distribution directory name to a weird
file descriptor.

bin/mdw-build

index bd1b457117baa51c59bbadbe80a1b4663c24a3f6..69a6642b7d6eca7f260c0e3e3b861bf99f345375 100755 (executable)
@@ -285,9 +285,10 @@ esac
 cat >find-distdir.mk <<'EOF'
 include Makefile
 print-distdir:
-       @echo $(distdir)
+       @echo >&3 $(distdir)
 EOF
-assign distdir $(make -f find-distdir.mk print-distdir)
+assign distdir \
+       $({ make -f find-distdir.mk print-distdir >/dev/null 2>&1; } 3>&1)
 
 ## Get a tarball distribution.
 case "$distcheck" in