From: Hans-Christoph Steiner Date: Mon, 30 Jun 2014 20:09:57 +0000 (-0400) Subject: fix bad syncing from local copy, force trailing slash to make rsync happy X-Git-Tag: 0.2.1~73^2~3 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=9dd138b25384e6b49b970b821f25fc119bdfd94b;p=fdroidserver.git 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/ --- diff --git a/fdroidserver/server.py b/fdroidserver/server.py index 9b46de70..4e902304 100644 --- a/fdroidserver/server.py +++ b/fdroidserver/server.py @@ -157,9 +157,9 @@ def _local_sync(fromdir, todir): def sync_from_localcopy(repo_section, local_copy_dir): logging.info('Syncing from local_copy_dir to this repo.') # trailing slashes have a meaning in rsync which is not needed here, so - # remove them all - _local_sync(os.path.join(local_copy_dir, repo_section).rstrip('/'), - repo_section.rstrip('/')) + # make sure both paths have exactly one trailing slash + _local_sync(os.path.join(local_copy_dir, repo_section).rstrip('/') + '/', + repo_section.rstrip('/') + '/') def update_localcopy(repo_section, local_copy_dir):