From 9b744d4b2536ec6c75f341bc4535eb93b203ee5a Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Wed, 30 Jul 2014 15:06:07 +0100 Subject: 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. --- scripts/release-upload | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'scripts') diff --git a/scripts/release-upload b/scripts/release-upload index f97e7e98..d3cc39e6 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() -- cgit v1.2.1