From 9fe096a2ae06ff08074bfe28619b0853f0d22867 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Fri, 27 Apr 2018 20:39:02 +0300 Subject: Fix: rsync action should use --delete-after --- NEWS | 2 ++ ick2/actions.py | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index a5f3663..0cc70d9 100644 --- a/NEWS +++ b/NEWS @@ -20,6 +20,8 @@ along with this program. If not, see . Version 0.48+git, not yet released ---------------------------------- +* The `rsync` action now deletes files from the target if they're not + in the source. Version 0.48, released 2018-04-27 ---------------------------------- diff --git a/ick2/actions.py b/ick2/actions.py index 4f3358f..9299609 100644 --- a/ick2/actions.py +++ b/ick2/actions.py @@ -355,7 +355,11 @@ class RsyncAction(Action): # pragma: no cover if not self._remote(rsync_target): env.report(1, 'rsync_target not acceptable\n') - argv = ['rsync', '-av', './' + rsync_src + '/.', rsync_target + '/.'] + argv = [ + 'rsync', '-av', '--delete-after', + './{}/.'.format(rsync_src), + '{}/.'.format(rsync_target), + ] exit_code = env.host_runcmd(argv, cwd=workspace) env.report(exit_code, 'rsync finished (exit code %d)\n' % exit_code) return exit_code -- cgit v1.2.1