|
@@ -1529,7 +1529,7 @@ class Project(object):
|
|
|
if os.path.exists(dstPath):
|
|
if os.path.exists(dstPath):
|
|
|
os.remove(dstPath)
|
|
os.remove(dstPath)
|
|
|
|
|
|
|
|
- cmd = ['curl', '--output', tmpPath, '--netrc', '--location']
|
|
|
|
|
|
|
+ cmd = ['curl', '--fail', '--output', tmpPath, '--netrc', '--location']
|
|
|
if quiet:
|
|
if quiet:
|
|
|
cmd += ['--silent']
|
|
cmd += ['--silent']
|
|
|
if os.path.exists(tmpPath):
|
|
if os.path.exists(tmpPath):
|
|
@@ -1549,9 +1549,19 @@ class Project(object):
|
|
|
except OSError:
|
|
except OSError:
|
|
|
return False
|
|
return False
|
|
|
|
|
|
|
|
- ok = proc.wait() == 0
|
|
|
|
|
|
|
+ curlret = proc.wait()
|
|
|
|
|
+
|
|
|
|
|
+ if curlret == 22:
|
|
|
|
|
+ # From curl man page:
|
|
|
|
|
+ # 22: HTTP page not retrieved. The requested url was not found or
|
|
|
|
|
+ # returned another error with the HTTP error code being 400 or above.
|
|
|
|
|
+ # This return code only appears if -f, --fail is used.
|
|
|
|
|
+ if not quiet:
|
|
|
|
|
+ print >> sys.stderr, "Server does not provide clone.bundle; ignoring."
|
|
|
|
|
+ return False
|
|
|
|
|
+
|
|
|
if os.path.exists(tmpPath):
|
|
if os.path.exists(tmpPath):
|
|
|
- if ok and os.stat(tmpPath).st_size > 16:
|
|
|
|
|
|
|
+ if curlret == 0 and os.stat(tmpPath).st_size > 16:
|
|
|
os.rename(tmpPath, dstPath)
|
|
os.rename(tmpPath, dstPath)
|
|
|
return True
|
|
return True
|
|
|
else:
|
|
else:
|