Index: sitescripts/subscriptions/bin/updateMalwareDomainsList.py |
=================================================================== |
--- a/sitescripts/subscriptions/bin/updateMalwareDomainsList.py |
+++ b/sitescripts/subscriptions/bin/updateMalwareDomainsList.py |
@@ -42,14 +42,13 @@ if __name__ == '__main__': |
zip = zipfile.ZipFile(StringIO(data), 'r') |
info = zip.infolist()[0] |
for line in str(zip.read(info.filename)).splitlines(): |
if not line: |
continue |
print >>file, '||%s^' % line.strip().decode('iso-8859-1') |
file.close(); |
- subprocess.check_call(['hg', '-q', 'commit', '-R', tempdir, '-A', '-u', 'hgbot', '-m', 'Updated malwaredomains.com data']) |
- |
- # Don't check the result of this call, it will be 1 if nothing needs pushing |
- subprocess.call(['hg', '-q', 'push', '-R', tempdir]) |
+ if subprocess.check_output(['hg', 'stat', '-R', tempdir]) != '': |
+ subprocess.check_call(['hg', '-q', 'commit', '-R', tempdir, '-A', '-u', 'hgbot', '-m', 'Updated malwaredomains.com data']) |
+ subprocess.call(['hg', '-q', 'push', '-R', tempdir]) |
Sebastian Noack
2013/07/05 22:06:08
If I understand it correctly, you check with hg st
|
finally: |
shutil.rmtree(tempdir, ignore_errors=True) |