mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-07 18:24:30 -04:00
Robustness improvements
This commit is contained in:
parent
424b9e1884
commit
dd7f18eb54
@ -508,12 +508,14 @@ def upload_to_servers(files, version): # {{{
|
||||
|
||||
def upload_to_dbs(files, version): # {{{
|
||||
print('Uploading to fosshub.com')
|
||||
sys.stdout.flush()
|
||||
server = 'mirror1.fosshub.com'
|
||||
rdir = 'release/'
|
||||
check_call(['ssh', 'kovid@%s' % server, 'rm -f release/*'])
|
||||
for x in files:
|
||||
start = time.time()
|
||||
print ('Uploading', x)
|
||||
sys.stdout.flush()
|
||||
for i in range(5):
|
||||
try:
|
||||
check_call(['rsync', '-h', '-z', '--progress', '-e', 'ssh -x', x,
|
||||
@ -522,10 +524,12 @@ def upload_to_dbs(files, version): # {{{
|
||||
raise SystemExit(1)
|
||||
except:
|
||||
print ('\nUpload failed, trying again in 30 seconds')
|
||||
sys.stdout.flush()
|
||||
time.sleep(30)
|
||||
else:
|
||||
break
|
||||
print ('Uploaded in', int(time.time() - start), 'seconds\n\n')
|
||||
sys.stdout.flush()
|
||||
check_call(['ssh', 'kovid@%s' % server, '/home/kovid/uploadFiles'])
|
||||
# }}}
|
||||
|
||||
|
@ -70,6 +70,10 @@ class ReUpload(Command): # {{{
|
||||
|
||||
def pre_sub_commands(self, opts):
|
||||
opts.replace = True
|
||||
exists = {x for x in installers() if os.path.exists(x)}
|
||||
if not exists:
|
||||
print ('There appear to be no installers!')
|
||||
raise SystemExit(1)
|
||||
|
||||
def run(self, opts):
|
||||
upload_signatures()
|
||||
|
Loading…
x
Reference in New Issue
Block a user