mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Linux installer: Fix downloading of signatures for older versions
Fixes #2042748 [Unable to install previous version in isolated mode](https://bugs.launchpad.net/calibre/+bug/2042748)
This commit is contained in:
parent
018ce6dd93
commit
b1aad38a4b
@ -654,8 +654,13 @@ def get_tarball_info(version):
|
|||||||
global dl_url, signature, calibre_version
|
global dl_url, signature, calibre_version
|
||||||
print('Downloading tarball signature securely...')
|
print('Downloading tarball signature securely...')
|
||||||
if version:
|
if version:
|
||||||
signature = get_https_resource_securely(
|
sigfname = 'calibre-' + version + '-' + arch + '.txz.sha512'
|
||||||
'https://code.calibre-ebook.com/signatures/calibre-' + version + '-' + arch + '.txz.sha512')
|
try:
|
||||||
|
signature = get_https_resource_securely('https://code.calibre-ebook.com/signatures/' + sigfname)
|
||||||
|
except HTTPError as err:
|
||||||
|
if err.code != 404:
|
||||||
|
raise
|
||||||
|
signature = get_https_resource_securely('https://code.calibre-ebook.com/signatures/old/' + sigfname)
|
||||||
calibre_version = version
|
calibre_version = version
|
||||||
dl_url = 'https://download.calibre-ebook.com/' + version + '/calibre-' + version + '-' + arch + '.txz'
|
dl_url = 'https://download.calibre-ebook.com/' + version + '/calibre-' + version + '-' + arch + '.txz'
|
||||||
else:
|
else:
|
||||||
@ -815,7 +820,7 @@ except NameError:
|
|||||||
|
|
||||||
|
|
||||||
def update_intaller_wrapper():
|
def update_intaller_wrapper():
|
||||||
# To run: python3 -c "import runpy; runpy.run_path('setup/linux-installer.py', run_name='update_wrapper')"
|
# To update: python3 -c "import runpy; runpy.run_path('setup/linux-installer.py', run_name='update_wrapper')"
|
||||||
with open(__file__, 'rb') as f:
|
with open(__file__, 'rb') as f:
|
||||||
src = f.read().decode('utf-8')
|
src = f.read().decode('utf-8')
|
||||||
wrapper = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'linux-installer.sh')
|
wrapper = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'linux-installer.sh')
|
||||||
|
@ -89,7 +89,8 @@ if py3:
|
|||||||
from urllib.parse import urlparse
|
from urllib.parse import urlparse
|
||||||
from urllib.request import BaseHandler, build_opener, Request, urlopen, getproxies, addinfourl
|
from urllib.request import BaseHandler, build_opener, Request, urlopen, getproxies, addinfourl
|
||||||
import http.client as httplib
|
import http.client as httplib
|
||||||
encode_for_subprocess = lambda x: x
|
def encode_for_subprocess(x):
|
||||||
|
return x
|
||||||
else:
|
else:
|
||||||
from future_builtins import map
|
from future_builtins import map
|
||||||
from urlparse import urlparse
|
from urlparse import urlparse
|
||||||
@ -702,8 +703,13 @@ def get_tarball_info(version):
|
|||||||
global dl_url, signature, calibre_version
|
global dl_url, signature, calibre_version
|
||||||
print('Downloading tarball signature securely...')
|
print('Downloading tarball signature securely...')
|
||||||
if version:
|
if version:
|
||||||
signature = get_https_resource_securely(
|
sigfname = 'calibre-' + version + '-' + arch + '.txz.sha512'
|
||||||
'https://code.calibre-ebook.com/signatures/calibre-' + version + '-' + arch + '.txz.sha512')
|
try:
|
||||||
|
signature = get_https_resource_securely('https://code.calibre-ebook.com/signatures/' + sigfname)
|
||||||
|
except HTTPError as err:
|
||||||
|
if err.code != 404:
|
||||||
|
raise
|
||||||
|
signature = get_https_resource_securely('https://code.calibre-ebook.com/signatures/old/' + sigfname)
|
||||||
calibre_version = version
|
calibre_version = version
|
||||||
dl_url = 'https://download.calibre-ebook.com/' + version + '/calibre-' + version + '-' + arch + '.txz'
|
dl_url = 'https://download.calibre-ebook.com/' + version + '/calibre-' + version + '-' + arch + '.txz'
|
||||||
else:
|
else:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user