From: Emil Velikov <emil.veli...@collabora.com>

Allows us to simplify the releasing process of every component and
ensure that we're not rebuilding in a location which might contain stale
files.

As we can no longer pass arguments to configure (which in itself
is a bad idea when using `make distcheck') we gain more reproducible
releasing process.

Signed-off-by: Emil Velikov <emil.veli...@collabora.com>
---
XXX:
 - The whole "./build.XXX" and "../" feel quite nasty. We have to use
relative paths, since they end up in the generated sources. I'm open to
suggestions :-)

 - Should we cleanup the tmp/build dir ourselves, how about the
autotool generated files ?

 - If people prefer (or if things are broken due to required flags to
configure) we can guard this, or the original behaviour, behind a --dist
like option.
---
 release.sh | 47 +++++++++++++++++++++++++----------------------
 1 file changed, 25 insertions(+), 22 deletions(-)

diff --git a/release.sh b/release.sh
index e374b02..eb28552 100755
--- a/release.sh
+++ b/release.sh
@@ -319,33 +319,27 @@ process_module() {
        return 1
     fi
 
+    if [ -e configure ]; then
+        echo "Error: the git repository contains configure"
+        echo "Did you forget to run git clean -fXd (and git clean -fxd) ?"
+        return 1
+    fi
 
-    # Change directory to be in the git build directory (could be 
out-of-source)
-    # More than one can be found when distcheck has run and failed
-    configNum=`find . -name config.status -type f | wc -l | sed 's:^ *::'`
+    # Create tmpdir for the build
+    build_dir=`mktemp -d -p . build.XXXXXXXXXX`
     if [ $? -ne 0 ]; then
-       echo "Error: failed to locate config.status."
-       echo "Has the module been configured?"
-       return 1
-    fi
-    if [ x"$configNum" = x0 ]; then
-       echo "Error: failed to locate config.status, has the module been 
configured?"
-       return 1
-    fi
-    if [ x"$configNum" != x1 ]; then
-       echo "Error: more than one config.status file was found,"
-       echo "       clean-up previously failed attempts at distcheck"
-       return 1
+        echo "Error: could not create a temporary directory for the build."
+        echo "Do you have coreutils' mktemp ?"
+        return 1
     fi
-    # create tmpdir
-    # run autogen.sh and/or equivalent
-    status_file=`find . -name config.status -type f`
+
+    echo "Info: generating configure."
+    autoreconf --force --install >/dev/null
     if [ $? -ne 0 ]; then
-       echo "Error: failed to locate config.status."
-       echo "Has the module been configured?"
-       return 1
+        echo "Error: failed generate configure."
+        return 1
     fi
-    build_dir=`dirname $status_file`
+
     cd $build_dir
     if [ $? -ne 0 ]; then
        echo "Error: failed to cd to $MODULE_RPATH/$build_dir."
@@ -353,6 +347,15 @@ process_module() {
        return 1
     fi
 
+    # Using ../ here feels a bit nasty, yet $top_src is an absolute path. Thus
+    # it will get propagated in the generated sources, which we do not want.
+    ../configure >/dev/null
+    if [ $? -ne 0 ]; then
+        echo "Error: failed to configure module."
+        cd $top_src
+        return 1
+    fi
+
     # Determine what is the current branch and the remote name
     current_branch=`git branch | $GREP "\*" | sed -e "s/\* //"`
     remote_name=`git config --get branch.$current_branch.remote`
-- 
2.8.2

_______________________________________________
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to