From 9a6ba34a5c91ef2785121f6a8d194652c6a11f38 Mon Sep 17 00:00:00 2001 From: Tobias Minich Date: Tue, 20 Jun 2023 15:17:57 +0200 Subject: [PATCH] Fixes cleanup if .xxh contains read-only directories (#161) --- xxh/xxh_xxh/xxh.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/xxh/xxh_xxh/xxh.py b/xxh/xxh_xxh/xxh.py index 70cbc55..bf24c08 100644 --- a/xxh/xxh_xxh/xxh.py +++ b/xxh/xxh_xxh/xxh.py @@ -940,10 +940,17 @@ def packages_operations(): if opt.install_force_full: self.eprint(f'Remove {host}:{host_xxh_home}') if self.local: + self.S('echo "chmod -R u+w {host_xxh_home}" | bash'.format( + host_xxh_home=host_xxh_home + )) self.S('echo "rm -rf {host_xxh_home}" | bash'.format( host_xxh_home=host_xxh_home )) else: + self.S('echo "chmod -R u+w {host_xxh_home}" | {ssh_pipe_command}'.format( + host_xxh_home=host_xxh_home, + ssh_pipe_command=ssh_pipe_command + )) self.S('echo "rm -rf {host_xxh_home}" | {ssh_pipe_command}'.format( host_xxh_home=host_xxh_home, ssh_pipe_command=ssh_pipe_command @@ -1148,7 +1155,7 @@ def packages_operations(): et_arguments=A(self.et_arguments, 0, 0), host=A(host), entrypoint_command=entrypoint_command - )) + )) else: self.S("{lcs} {sshpass} {ssh} {ssh_arg_v} {ssh_arguments} {host} -t '{entrypoint_command}'".format( lcs=A(lcs), @@ -1165,10 +1172,17 @@ def packages_operations(): self.eprint(f'Remove {host}:{host_xxh_home}') if self.local: + self.S('echo "chmod -R u+w {host_xxh_home}" | bash'.format( + host_xxh_home=host_xxh_home + )) self.S('echo "rm -rf {host_xxh_home}" | bash'.format( host_xxh_home=host_xxh_home )) else: + self.S('echo "chmod -R u+w {host_xxh_home}" | {ssh_pipe_command}'.format( + host_xxh_home=host_xxh_home, + ssh_pipe_command=ssh_pipe_command + )) self.S('echo "rm -rf {host_xxh_home}" | {ssh_pipe_command}'.format( host_xxh_home=host_xxh_home, ssh_pipe_command=ssh_pipe_command