Index: sitescripts/subscriptions/bin/updateSubscriptionDownloads.py |
=================================================================== |
--- a/sitescripts/subscriptions/bin/updateSubscriptionDownloads.py |
+++ b/sitescripts/subscriptions/bin/updateSubscriptionDownloads.py |
@@ -30,18 +30,18 @@ if __name__ == '__main__': |
sourceTemp = {} |
destTemp = None |
try: |
destTemp = tempfile.mkdtemp() |
for repoName, repoDir in sourceRepos.iteritems(): |
tempDir = tempfile.mkdtemp() |
sourceTemp[repoName] = tempDir |
- subprocess.Popen(['hg', 'archive', '-R', repoDir, '-r', 'default', tempDir]).communicate() |
- subprocess.Popen(['rsync', '-a', '--delete', destDir + '/', destTemp]).communicate() |
+ subprocess.check_call(['hg', 'archive', '-R', repoDir, '-r', 'default', tempDir]) |
+ subprocess.check_call(['rsync', '-a', '--delete', destDir + '/', destTemp]) |
Sebastian Noack
2013/07/04 13:57:51
There is no need to hard-code path separators. Use
Wladimir Palant
2013/07/05 11:24:33
os.path.join() won't help here - rsync requires th
|
combineSubscriptions(sourceTemp, destTemp) |
- subprocess.Popen(['rsync', '-au', '--delete', destTemp + '/', destDir]).communicate() |
+ subprocess.check_call(['rsync', '-au', '--delete', destTemp + '/', destDir]) |
Sebastian Noack
2013/07/04 13:57:51
See above.
|
finally: |
for tempDir in sourceTemp.itervalues(): |
if os.path.exists(tempDir): |
shutil.rmtree(tempDir, True) |
if destTemp and os.path.exists(destTemp): |
shutil.rmtree(destTemp, True) |