[PATCH v2 util-modular] release.sh: create a worktree structure that's out of reach of libtool

Peter Hutterer peter.hutterer at who-t.net
Wed Mar 8 22:23:24 UTC 2017


The comment in the diff says it all, we need to put our worktree root at least
two directories away from our normal checkout because most repos don't have
AC_CONFIG_AUX_DIR() set.

This fixes the issue of release.sh failing in git trees that haven't been git
cleaned:

    ERROR: files left in build directory after distclean:
    ./config.sub
    ./test-driver
    ./ltmain.sh
    ./config.guess
    ./install-sh
    ./missing
    ./depcomp
    ./compile
    make[1]: *** [distcleancheck] Error 1
    make: *** [distcheck] Error 1

Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
Changes to v1:
- now with new and improved typos :)
- add note about AC_CONFIG_AUX_DIR
- change path to release/$section/, section is the only thing we have
  available this early

 release.sh | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/release.sh b/release.sh
index c824dea..0e9261b 100755
--- a/release.sh
+++ b/release.sh
@@ -357,13 +357,26 @@ process_module() {
 	return 1
     fi
 
+    # If AC_CONFIG_AUX_DIR isn't set, libtool will search down to ../.. for
+    # install-sh and then just guess that's the aux dir, dumping config.sub
+    # and other files into that directory. make distclean then complains
+    # about leftover files. So let's put our real module dir out of reach of
+    # libtool.
+    #
+    # We use release/$section/$build_dir because git worktree will pick the
+    # last part as branch identifier, so it needs to be random to avoid
+    # conflicts.
+    build_dir="release/$section"
+    mkdir -p "$build_dir"
+
     # Create tmpdir for the release
-    build_dir=`mktemp -d -p . build.XXXXXXXXXX`
+    tmpdir=`mktemp -d -p . build.XXXXXXXXXX`
     if [ $? -ne 0 ]; then
         echo "Error: could not create a temporary directory for the release"
         echo "Do you have coreutils' mktemp ?"
         return 1
     fi
+    build_dir="$build_dir/$tmpdir"
 
     # Worktree removal is intentionally left to the user, due to:
     #  - currently we cannot select only one worktree to prune
-- 
2.9.3



More information about the xorg-devel mailing list