浏览代码

git clone called with option -q. Refs: #112.
suppresses the progress reporting on stderr, which would be
misinterpreted as an error by the build script.

Josef Templ 9 年之前
父节点
当前提交
232d5fd4d9
共有 1 个文件被更改,包括 2 次插入26 次删除
  1. 2 26
      appbuild/build.py

+ 2 - 26
appbuild/build.py

@@ -145,31 +145,6 @@ def shellExec(wd, cmd, stopOnError=True):
         renameLog() # if not args.test
         sys.exit()
 
-def cloneRepo(wd, cmd, stopOnError=True):
-    # like shellExecute but cloning fails sometimes for unknown reasons, so we treat it
-    # separately in order to find out what is going on
-    # this function is for debugging only; TODO remove when cloneRepo bug is fixed
-    cmd = "cd " + wd + " && " + cmd
-    for cnt in range(1, 3):
-        logShell(cmd)
-        (stdout, stderr) = Popen(cmd, stdout=PIPE, stderr=PIPE, shell=True).communicate()
-        log(stdout)
-        if stderr == "":
-            return stdout
-        elif not stopOnError:
-            logErr(stderr)
-            logErr("--- error ignored ---")
-            return stdout
-        else:
-            logErr(stderr)
-            logErr("--- cloneRepo failed ---")
-            print "--- cloneRepo failed ---\n"
-            print "--- stdout=" + stdout + "\n"
-            print "--- stderr=" + stderr + "\n"
-            time.sleep(2) # sleep 2 seconds before retry
-    print "severe error when cloning the repository: please inspect manually\n"
-    sys.exit()
-
 def getAppVerName(appVersion):
     x = appVersion
     if appVersion.find("-a") >= 0:
@@ -360,7 +335,8 @@ log("<h2>Build " + str(buildNum) + " from '" + branch + "' at " + buildDate + "<
 log("<h3>git commit hash: " + commitHash + "</h3>")
 
 logStep("Cloning repository into temporary folder '" + bbName + "'")
-cloneRepo(buildDir, "git clone --branch " + branch + " " + localRepository + " " + bbDir)
+# option -q suppresses the progress reporting on stderr
+shellExec(buildDir, "git clone -q --branch " + branch + " " + localRepository + " " + bbDir)
 
 if not os.path.exists(appbuildDir + "/AppVersion.txt"):
     cleanup() # if not args.test