mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-09-13 22:42:29 +03:00
index: remove unused, confusing args to file_entry()
This commit is contained in:
parent
21c4c118a1
commit
e79585b0c0
1 changed files with 5 additions and 11 deletions
|
@ -489,17 +489,11 @@ def dict_diff(source, target):
|
|||
return result
|
||||
|
||||
|
||||
def file_entry(filename, hashType=None, hsh=None, size=None):
|
||||
def file_entry(filename, hash_value=None):
|
||||
meta = {}
|
||||
meta["name"] = "/" + filename.split("/", 1)[1]
|
||||
if hsh:
|
||||
meta[hashType] = hsh
|
||||
if hsh != "sha256":
|
||||
meta["sha256"] = common.sha256sum(filename)
|
||||
if size:
|
||||
meta["size"] = size
|
||||
else:
|
||||
meta["size"] = os.stat(filename).st_size
|
||||
meta["sha256"] = hash_value or common.sha256sum(filename)
|
||||
meta["size"] = os.stat(filename).st_size
|
||||
return meta
|
||||
|
||||
|
||||
|
@ -619,13 +613,13 @@ def convert_version(version, app, repodir):
|
|||
if "obbMainFile" in version:
|
||||
ver["obbMainFile"] = file_entry(
|
||||
os.path.join(repodir, version["obbMainFile"]),
|
||||
"sha256", version["obbMainFileSha256"]
|
||||
version["obbMainFileSha256"],
|
||||
)
|
||||
|
||||
if "obbPatchFile" in version:
|
||||
ver["obbPatchFile"] = file_entry(
|
||||
os.path.join(repodir, version["obbPatchFile"]),
|
||||
"sha256", version["obbPatchFileSha256"]
|
||||
version["obbPatchFileSha256"],
|
||||
)
|
||||
|
||||
ver["manifest"] = manifest = {}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue