mirror of
https://gerrit.googlesource.com/git-repo
synced 2025-01-02 16:14:25 +00:00
Ensure repo waits for child process to terminate
See http://stackoverflow.com/questions/7004687/os-exec-on-windows: execv on Windows does not behave as on Linux, i.e. a new process is spawned and the parent process terminates right away, which makes the shell prompt come back too soon. Change-Id: I1f8d23208765988629f081e9b949c67cf71c08ae
This commit is contained in:
parent
a24671f661
commit
35d22217a5
6
repo
6
repo
@ -120,6 +120,7 @@ GITC_FS_ROOT_DIR = '/gitc/manifest-rw/'
|
|||||||
|
|
||||||
import errno
|
import errno
|
||||||
import optparse
|
import optparse
|
||||||
|
import platform
|
||||||
import re
|
import re
|
||||||
import shutil
|
import shutil
|
||||||
import stat
|
import stat
|
||||||
@ -887,7 +888,10 @@ def main(orig_args):
|
|||||||
me.extend(orig_args)
|
me.extend(orig_args)
|
||||||
me.extend(extra_args)
|
me.extend(extra_args)
|
||||||
try:
|
try:
|
||||||
os.execv(sys.executable, me)
|
if platform.system() == "Windows":
|
||||||
|
sys.exit(subprocess.call(me))
|
||||||
|
else:
|
||||||
|
os.execv(sys.executable, me)
|
||||||
except OSError as e:
|
except OSError as e:
|
||||||
_print("fatal: unable to start %s" % repo_main, file=sys.stderr)
|
_print("fatal: unable to start %s" % repo_main, file=sys.stderr)
|
||||||
_print("fatal: %s" % e, file=sys.stderr)
|
_print("fatal: %s" % e, file=sys.stderr)
|
||||||
|
Loading…
Reference in New Issue
Block a user