mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix dupes being generated when uploading to fosshub
This commit is contained in:
parent
00d2e7a03b
commit
b1bd22b20e
@ -124,8 +124,8 @@ def run_remote_upload(args):
|
|||||||
|
|
||||||
# }}}
|
# }}}
|
||||||
|
|
||||||
def upload_to_fosshub(files=None):
|
def upload_to_fosshub():
|
||||||
if files is None:
|
# fosshub has no API to do partial uploads, so we always upload all files.
|
||||||
files = set(installers())
|
files = set(installers())
|
||||||
entries = []
|
entries = []
|
||||||
for fname in files:
|
for fname in files:
|
||||||
@ -136,7 +136,8 @@ def upload_to_fosshub(files=None):
|
|||||||
'type': desc,
|
'type': desc,
|
||||||
'version': __version__,
|
'version': __version__,
|
||||||
})
|
})
|
||||||
jq = {'software': 'Calibre', 'apiKey':get_fosshub_data(), 'upload':entries}
|
jq = {'software': 'Calibre', 'apiKey':get_fosshub_data(), 'upload':entries, 'delete':[{'type':'*', 'version':'*', 'name':'*'}]}
|
||||||
|
# print(json.dumps(jq, indent=2))
|
||||||
rq = urllib2.urlopen('https://www.fosshub.com/JSTools/uploadJson', urllib.urlencode({'content':json.dumps(jq)}))
|
rq = urllib2.urlopen('https://www.fosshub.com/JSTools/uploadJson', urllib.urlencode({'content':json.dumps(jq)}))
|
||||||
resp = rq.read()
|
resp = rq.read()
|
||||||
if rq.getcode() != httplib.OK:
|
if rq.getcode() != httplib.OK:
|
||||||
@ -149,6 +150,7 @@ class UploadInstallers(Command): # {{{
|
|||||||
parser.add_option('--replace', default=False, action='store_true', help='Replace existing installers')
|
parser.add_option('--replace', default=False, action='store_true', help='Replace existing installers')
|
||||||
|
|
||||||
def run(self, opts):
|
def run(self, opts):
|
||||||
|
# return upload_to_fosshub()
|
||||||
all_possible = set(installers())
|
all_possible = set(installers())
|
||||||
available = set(glob.glob('dist/*'))
|
available = set(glob.glob('dist/*'))
|
||||||
files = {x:installer_description(x) for x in
|
files = {x:installer_description(x) for x in
|
||||||
@ -168,7 +170,7 @@ class UploadInstallers(Command): # {{{
|
|||||||
upload_signatures()
|
upload_signatures()
|
||||||
check_call('ssh code /apps/update-calibre-version.py'.split())
|
check_call('ssh code /apps/update-calibre-version.py'.split())
|
||||||
# self.upload_to_sourceforge()
|
# self.upload_to_sourceforge()
|
||||||
upload_to_fosshub(files)
|
upload_to_fosshub()
|
||||||
self.upload_to_github(opts.replace)
|
self.upload_to_github(opts.replace)
|
||||||
finally:
|
finally:
|
||||||
shutil.rmtree(tdir, ignore_errors=True)
|
shutil.rmtree(tdir, ignore_errors=True)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user