print 'Error: TRIGGER_INFO doesn\'t contain %s'
return 1
+ #TODO: If download_num differs from note, do not proceed!
+ if 'download_num' in fields:
+ try:
+ if 0 == sync_get(os.path.join(sync_dest, 'buildinfo.in'), 'tmp_download_num'):
+ H = dict(line.strip().split('=') for line in open('tmp_download_num'))
+ print H
+ if int(H['download_num']) != int(fields['download_num']):
+ print 'DO NOT sync! download_num differs: %s, %s' \
+ % (fields['download_num'], H['download_num'])
+ return
+ except Exception, err:
+ print 'Error while reading note! %s' % str(err)
+
build_id = fields["buildid"]
name = fields['name']