git-svn-id: https://s3tools.svn.sourceforge.net/svnroot/s3tools/s3cmd/trunk@275 830e0280-6d2a-0410-9c65-932aecc39d9d
Michal Ludvig authored on 2008/11/29 08:59:20... | ... |
@@ -503,6 +503,10 @@ def cmd_sync_remote2local(src, dst): |
503 | 503 |
src_uri = S3Uri(src) |
504 | 504 |
dst_uri = S3Uri(dst) |
505 | 505 |
|
506 |
+ src_base = src_uri.uri() |
|
507 |
+ dst_base = dst_uri.path() |
|
508 |
+ if not src_base[-1] == "/": src_base += "/" |
|
509 |
+ |
|
506 | 510 |
rem_list = _get_filelist_remote(src_uri) |
507 | 511 |
rem_count = len(rem_list) |
508 | 512 |
|
... | ... |
@@ -517,8 +521,8 @@ def cmd_sync_remote2local(src, dst): |
517 | 517 |
|
518 | 518 |
for file in loc_list: |
519 | 519 |
if cfg.delete_removed: |
520 |
- # os.unlink(file) |
|
521 |
- output("deleted '%s'" % file) |
|
520 |
+ os.unlink(dst_base + file) |
|
521 |
+ output("deleted '%s'" % (dst_base + file)) |
|
522 | 522 |
else: |
523 | 523 |
output("not-deleted '%s'" % file) |
524 | 524 |
|
... | ... |
@@ -528,9 +532,6 @@ def cmd_sync_remote2local(src, dst): |
528 | 528 |
timestamp_start = time.time() |
529 | 529 |
seq = 0 |
530 | 530 |
dir_cache = {} |
531 |
- src_base = src_uri.uri() |
|
532 |
- dst_base = dst_uri.path() |
|
533 |
- if not src_base[-1] == "/": src_base += "/" |
|
534 | 531 |
file_list = rem_list.keys() |
535 | 532 |
file_list.sort() |
536 | 533 |
for file in file_list: |