summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--NEWS2
-rw-r--r--ick2/actions.py6
2 files changed, 7 insertions, 1 deletions
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 <http://www.gnu.org/licenses/>.
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