aboutsummaryrefslogtreecommitdiff
path: root/scripts/remote_build.py
diff options
context:
space:
mode:
authorMartin Ridgers <[email protected]>2022-02-23 09:15:32 +0100
committerMartin Ridgers <[email protected]>2022-02-23 09:15:32 +0100
commitd818ddfcd24ab0dd3392e37cc1422ff2efcb2e8f (patch)
tree8787c60421b2a2c3e16e01be40cc1396b2d092f1 /scripts/remote_build.py
parentAdded a summary about Linux's zenserver AppImage bundle (diff)
downloadzen-d818ddfcd24ab0dd3392e37cc1422ff2efcb2e8f.tar.xz
zen-d818ddfcd24ab0dd3392e37cc1422ff2efcb2e8f.zip
remote_build: convert given key file to Unix line endings
Diffstat (limited to 'scripts/remote_build.py')
-rw-r--r--scripts/remote_build.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/scripts/remote_build.py b/scripts/remote_build.py
index 08e44c9ad..70f9cf9bf 100644
--- a/scripts/remote_build.py
+++ b/scripts/remote_build.py
@@ -106,13 +106,15 @@ def _local(args):
_header("Validating remote host and credentials")
- # Validate key file. OpenSSL needs a trailing EOL, LibreSSL doesn't
+ # Validate key file. Git's SSH uses OpenSSL which needs UNIX line-endings
if args.keyfile:
with open(args.keyfile, "rt") as key_file:
- lines = [x for x in key_file]
- if not lines[-1].endswith("\n"):
- print("!! ERROR: key file must end with a new line")
- return 1
+ lines = [x.strip() for x in key_file]
+
+ with open(args.keyfile, "wb") as key_file:
+ for line in lines:
+ key_file.write(line.encode() + b"\n")
+
identity = ("-i", args.keyfile)
else:
identity = ()