checks/installation-without-system: modify to install through normal user instead of root

This commit is contained in:
Qubasa
2025-03-26 18:35:20 +01:00
parent 351ce1414a
commit d1a79653fe
3 changed files with 50 additions and 8 deletions

View File

@@ -64,8 +64,24 @@ def upload(
*host.ssh_cmd(),
"--",
*priviledge_escalation,
"bash", "-c", "exec \"$@\"", "--",
f"rm -r {remote_dest!s} ; mkdir -m {dir_mode:o} -p {str(remote_dest)} && tar -C {str(remote_dest)} -xzf -",
"bash",
"-c",
'exec "$@"',
"--",
"rm",
"-r",
str(remote_dest),
"mkdir",
"-m",
f"{dir_mode:o}",
"-p",
str(remote_dest),
"&&",
"tar",
"-C",
str(remote_dest),
"-xzf",
"-",
]
else:
# For single file, extract to parent directory and ensure correct name
@@ -73,8 +89,24 @@ def upload(
*host.ssh_cmd(),
"--",
*priviledge_escalation,
"bash", "-c", "exec \"$@\"", "--",
f"rm -f {str(remote_dest)} ; mkdir -m {dir_mode:o} -p {str(remote_dest.parent)} && tar -C {str(remote_dest.parent)} -xzf -",
"bash",
"-c",
'exec "$@"',
"--",
"rm",
"-r",
str(remote_dest),
"mkdir",
"-m",
f"{dir_mode:o}",
"-p",
str(remote_dest.parent),
"&&",
"tar",
"-C",
str(remote_dest.parent),
"-xzf",
"-",
]
# TODO accept `input` to be an IO object instead of bytes so that we don't have to read the tarfile into memory.