aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorMartin Ridgers <[email protected]>2022-02-10 15:24:10 +0100
committerMartin Ridgers <[email protected]>2022-02-11 10:46:06 +0100
commit7c3136011a29c2cc26b838661c138225c956e3ac (patch)
tree9a5f3842220750f0c72cc2b78fd60e254bdb99ce /scripts
parentremote_build: build by commit instead of a remote/branch ref (diff)
downloadzen-7c3136011a29c2cc26b838661c138225c956e3ac.tar.xz
zen-7c3136011a29c2cc26b838661c138225c956e3ac.zip
remote_build: better handling of git-daemon processes
Diffstat (limited to 'scripts')
-rw-r--r--scripts/remote_build.py24
1 files changed, 7 insertions, 17 deletions
diff --git a/scripts/remote_build.py b/scripts/remote_build.py
index 71b8b500e..7acad2870 100644
--- a/scripts/remote_build.py
+++ b/scripts/remote_build.py
@@ -53,14 +53,11 @@ def _find_binary(name):
raise EnvironmentError(f"Unable to find '{name}' in the path")
#-------------------------------------------------------------------------------
-class _AutoKill(object):
- def __init__(self, proc):
- self._proc = proc
-
+class _DaemonAutoKill(object):
def __del__(self):
- self._proc.kill()
- self._proc.wait()
- pass
+ # Roundabout way to avoid orphaned git-daemon processes
+ if os.name == "nt":
+ os.system("taskkill /f /im git-daemon.exe")
@@ -152,7 +149,7 @@ def _local(args):
#stdout = daemon_log,
stderr = subprocess.STDOUT
)
- daemon_killer = _AutoKill(daemon)
+ daemon_killer = _DaemonAutoKill()
# Run this script on the remote machine
_header("Running SSH")
@@ -261,14 +258,7 @@ if __name__ == "__main__":
ret = _remote(sys.argv[2:])
raise SystemExit(ret)
- try:
- ret = _local(sys.argv[1:])
- raise SystemExit(ret)
- except:
- raise
- finally:
- # Roundabout way to avoid orphaned git-daemon processes
- if os.name == "nt":
- os.system("taskkill /f /im git-daemon.exe")
+ ret = _local(sys.argv[1:])
+ raise SystemExit(ret)
# vim: expandtab foldlevel=1 foldmethod=marker