[PATCH modular 08/10] Clean up "clone" logic.

Trevor Woerner twoerner at gmail.com
Thu Sep 30 14:28:36 PDT 2010


From: Trevor Woerner <twoerner at gmail.com>

Only if cloning succeeds, set SRCDIR and CONFCMD. If SRCDIR is later
discovered the be empty the module can't be processed.

Signed-off-by: Trevor Woerner <twoerner at gmail.com>
---
 build.sh |   13 ++++++-------
 1 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/build.sh b/build.sh
index 8ee100e..ae7d34e 100755
--- a/build.sh
+++ b/build.sh
@@ -204,10 +204,12 @@ clone() {
     if [ ! -d "$DIR" ]; then
         git clone "$GITROOT/$BASEDIR$DIR" "$DIR"
         if [ $? -ne 0 ] && [ ! -d "$DIR" ]; then
+            echo "Failed to clone $1 module component $2. Ignoring."
+            clonefailed_components="$clonefailed_components $1/$2"
             return 1
         fi
     else
-        # git cannot clone into an existing directory
+        echo "git cannot clone into an existing directory $1/$2"
 	return 1
     fi
 
@@ -239,13 +241,10 @@ process() {
         CONFCMD="autogen.sh"
     elif [ X"$CLONE" != X ]; then
         clone $1 $2
-        if [ $? -ne 0 ]; then
-            echo "Failed to clone $1 module component $2. Ignoring."
-            clonefailed_components="$clonefailed_components $1/$2"
-            return 1
+        if [ $? -eq 0 ]; then
+	    SRCDIR="$1/$2"
+	    CONFCMD="autogen.sh"
         fi
-        SRCDIR="$1/$2"
-        CONFCMD="autogen.sh"
     else
         checkfortars $1 $2
         CONFCMD="configure"
-- 
1.7.3.1.45.g9855b



More information about the xorg-devel mailing list