mirror of
https://gitlab.com/fdroid/fdroidserver.git
synced 2024-11-14 19:10:11 +01:00
ignore cache on key name change, instead of crashing
In 6c2cf2ccdd
, the names of some essential
data bits changed. If those names are not in the tmp/apkcache, then
`fdroid update` shouldn't crash but instead just ignore that cache entry.
tmp/apkcache should be deleted since the metadata version was bumped, but
I guess that does not always happen.
This commit is contained in:
parent
5ad3486741
commit
4d50ab9bad
@ -682,7 +682,7 @@ def scan_repo_files(apkcache, repodir, knownapks, use_date_from_file=False):
|
|||||||
repo_file['added'] = a
|
repo_file['added'] = a
|
||||||
else:
|
else:
|
||||||
repo_file['added'] = datetime(*a[:6])
|
repo_file['added'] = datetime(*a[:6])
|
||||||
if repo_file['hash'] == shasum:
|
if repo_file.get('hash') == shasum:
|
||||||
logging.debug("Reading " + name + " from cache")
|
logging.debug("Reading " + name + " from cache")
|
||||||
usecache = True
|
usecache = True
|
||||||
else:
|
else:
|
||||||
@ -759,7 +759,7 @@ def scan_apk(apkcache, apkfilename, repodir, knownapks, use_date_from_apk):
|
|||||||
usecache = False
|
usecache = False
|
||||||
if apkfilename in apkcache:
|
if apkfilename in apkcache:
|
||||||
apk = apkcache[apkfilename]
|
apk = apkcache[apkfilename]
|
||||||
if apk['hash'] == shasum:
|
if apk.get('hash') == shasum:
|
||||||
logging.debug("Reading " + apkfilename + " from cache")
|
logging.debug("Reading " + apkfilename + " from cache")
|
||||||
usecache = True
|
usecache = True
|
||||||
else:
|
else:
|
||||||
|
Loading…
Reference in New Issue
Block a user