mirror of
https://gitlab.com/fdroid/fdroidserver.git
synced 2024-11-19 21:30:10 +01:00
versioned download_repo_index_v1() to be future proof
This commit is contained in:
parent
f7b8a100c7
commit
723873456d
@ -36,9 +36,11 @@ from fdroidserver.common import (verify_apk_signature,
|
|||||||
verify_apk_signature # NOQA: B101
|
verify_apk_signature # NOQA: B101
|
||||||
generate_keystore # NOQA: B101
|
generate_keystore # NOQA: B101
|
||||||
from fdroidserver.index import (download_repo_index,
|
from fdroidserver.index import (download_repo_index,
|
||||||
|
download_repo_index_v1,
|
||||||
get_mirror_service_urls,
|
get_mirror_service_urls,
|
||||||
make as make_index) # NOQA: E402
|
make as make_index) # NOQA: E402
|
||||||
download_repo_index # NOQA: B101
|
download_repo_index # NOQA: B101
|
||||||
|
download_repo_index_v1 # NOQA: B101
|
||||||
get_mirror_service_urls # NOQA: B101
|
get_mirror_service_urls # NOQA: B101
|
||||||
make_index # NOQA: B101
|
make_index # NOQA: B101
|
||||||
from fdroidserver.update import (process_apk,
|
from fdroidserver.update import (process_apk,
|
||||||
|
@ -1476,7 +1476,17 @@ def get_mirror_service_urls(url):
|
|||||||
|
|
||||||
|
|
||||||
def download_repo_index(url_str, etag=None, verify_fingerprint=True, timeout=600):
|
def download_repo_index(url_str, etag=None, verify_fingerprint=True, timeout=600):
|
||||||
"""Download and verifies index file, then returns its data.
|
"""Download and verifies index v1 file, then returns its data.
|
||||||
|
|
||||||
|
Use the versioned functions to be sure you are getting the
|
||||||
|
expected data format.
|
||||||
|
|
||||||
|
"""
|
||||||
|
return download_repo_index_v1(url_str, etag, verify_fingerprint, timeout)
|
||||||
|
|
||||||
|
|
||||||
|
def download_repo_index_v1(url_str, etag=None, verify_fingerprint=True, timeout=600):
|
||||||
|
"""Download and verifies index v1 file, then returns its data.
|
||||||
|
|
||||||
Downloads the repository index from the given :param url_str and
|
Downloads the repository index from the given :param url_str and
|
||||||
verifies the repository's fingerprint if :param verify_fingerprint
|
verifies the repository's fingerprint if :param verify_fingerprint
|
||||||
@ -1489,7 +1499,7 @@ def download_repo_index(url_str, etag=None, verify_fingerprint=True, timeout=600
|
|||||||
Returns
|
Returns
|
||||||
-------
|
-------
|
||||||
A tuple consisting of:
|
A tuple consisting of:
|
||||||
- The index in JSON format or None if the index did not change
|
- The index in JSON v1 format or None if the index did not change
|
||||||
- The new eTag as returned by the HTTP request
|
- The new eTag as returned by the HTTP request
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
Loading…
Reference in New Issue
Block a user