fix bad syncing from local copy, force trailing slash to make rsync happy

It seems that paths for rsync must have a trailing slash in order to sync
rather than make a subdir, i.e. this makes a duplicate subdir:

  rsync /tmp/fdroid/repo repo

While this syncs the dirs

  rsync /tmp/fdroid/repo/ repo/
This commit is contained in:
Hans-Christoph Steiner 2014-06-30 16:09:57 -04:00
parent 3dbe503071
commit 9dd138b253

View file

@ -157,9 +157,9 @@ def _local_sync(fromdir, todir):
def sync_from_localcopy(repo_section, local_copy_dir): def sync_from_localcopy(repo_section, local_copy_dir):
logging.info('Syncing from local_copy_dir to this repo.') logging.info('Syncing from local_copy_dir to this repo.')
# trailing slashes have a meaning in rsync which is not needed here, so # trailing slashes have a meaning in rsync which is not needed here, so
# remove them all # make sure both paths have exactly one trailing slash
_local_sync(os.path.join(local_copy_dir, repo_section).rstrip('/'), _local_sync(os.path.join(local_copy_dir, repo_section).rstrip('/') + '/',
repo_section.rstrip('/')) repo_section.rstrip('/') + '/')
def update_localcopy(repo_section, local_copy_dir): def update_localcopy(repo_section, local_copy_dir):