diff options
author | Michael Drake <michael.drake@codethink.co.uk> | 2014-07-30 15:06:07 +0100 |
---|---|---|
committer | Michael Drake <michael.drake@codethink.co.uk> | 2014-07-30 15:06:07 +0100 |
commit | 9b744d4b2536ec6c75f341bc4535eb93b203ee5a (patch) | |
tree | d0a52900213ebe94f6ca1672b07164b826491444 /scripts/release-upload | |
parent | 0ad896ece6ce1d1fe78b9f8e35acfccaadb18a1f (diff) | |
download | definitions-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.
Diffstat (limited to 'scripts/release-upload')
-rwxr-xr-x | scripts/release-upload | 15 |
1 files changed, 9 insertions, 6 deletions
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() |