summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2018-04-27 20:39:02 +0300
committerLars Wirzenius <liw@liw.fi>2018-04-27 21:09:50 +0300
commit9fe096a2ae06ff08074bfe28619b0853f0d22867 (patch)
tree06a9cb39748ba0d994b8a18fc7375191a45072d9
parente369b8b9c04b8c7e54a3bdf6c227f9c903665021 (diff)
downloadick2-9fe096a2ae06ff08074bfe28619b0853f0d22867.tar.gz
Fix: rsync action should use --delete-after
-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