summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Drake <michael.drake@codethink.co.uk>2014-07-30 14:06:07 (GMT)
committerMichael Drake <michael.drake@codethink.co.uk>2014-07-30 14:06:07 (GMT)
commit9b744d4b2536ec6c75f341bc4535eb93b203ee5a (patch)
treed0a52900213ebe94f6ca1672b07164b826491444
parent0ad896ece6ce1d1fe78b9f8e35acfccaadb18a1f (diff)
downloaddefinitions-9b744d4b2536ec6c75f341bc4535eb93b203ee5a.tar.gz
Fix releasing when no changes to the cache are required
Without this change the rsync and xargs commands will wait forever for input that will never arrive.
-rwxr-xr-xscripts/release-upload15
1 files changed, 9 insertions, 6 deletions
diff --git a/scripts/release-upload b/scripts/release-upload
index f97e7e9..d3cc39e 100755
--- a/scripts/release-upload
+++ b/scripts/release-upload
@@ -416,17 +416,20 @@ def rsync_files_to_server(
'{user}@{host}:{path}'.format(user=user, host=host, path=target_dir),
]
- files_list = ''.join(
- '{0}\0'.format(filename) for filename in source_filenames)
+ files_list = '\0'.join(
+ filename for filename in source_filenames) + '\0'
cliapp.runcmd(argv, feed_stdin=files_list, stdout=None, stderr=None)
def set_permissions_on_server(user, host, target_dir, filenames):
+ # If we have no files, we can't form a valid command to run on the server
+ if not filenames:
+ return
target = '{user}@{host}'.format(user=user, host=host)
- argv = ['chmod', '0644']
- for filename in filenames:
- argv.append(os.path.join(target_dir, filename))
- cliapp.ssh_runcmd(target, argv)
+ argv = ['xargs', '-0', 'chmod', '0644']
+ files_list = ''.join(
+ '{0}\0'.format(os.path.join(target_dir, filename)) for filename in filenames)
+ cliapp.ssh_runcmd(target, argv, feed_stdin=files_list, stdout=None, stderr=None)
ReleaseUploader(description=__doc__).run()