mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-09-14 06:52:39 +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
|
return result
|
||||||
|
|
||||||
|
|
||||||
def file_entry(filename, hashType=None, hsh=None, size=None):
|
def file_entry(filename, hash_value=None):
|
||||||
meta = {}
|
meta = {}
|
||||||
meta["name"] = "/" + filename.split("/", 1)[1]
|
meta["name"] = "/" + filename.split("/", 1)[1]
|
||||||
if hsh:
|
meta["sha256"] = hash_value or common.sha256sum(filename)
|
||||||
meta[hashType] = hsh
|
meta["size"] = os.stat(filename).st_size
|
||||||
if hsh != "sha256":
|
|
||||||
meta["sha256"] = common.sha256sum(filename)
|
|
||||||
if size:
|
|
||||||
meta["size"] = size
|
|
||||||
else:
|
|
||||||
meta["size"] = os.stat(filename).st_size
|
|
||||||
return meta
|
return meta
|
||||||
|
|
||||||
|
|
||||||
|
@ -619,13 +613,13 @@ def convert_version(version, app, repodir):
|
||||||
if "obbMainFile" in version:
|
if "obbMainFile" in version:
|
||||||
ver["obbMainFile"] = file_entry(
|
ver["obbMainFile"] = file_entry(
|
||||||
os.path.join(repodir, version["obbMainFile"]),
|
os.path.join(repodir, version["obbMainFile"]),
|
||||||
"sha256", version["obbMainFileSha256"]
|
version["obbMainFileSha256"],
|
||||||
)
|
)
|
||||||
|
|
||||||
if "obbPatchFile" in version:
|
if "obbPatchFile" in version:
|
||||||
ver["obbPatchFile"] = file_entry(
|
ver["obbPatchFile"] = file_entry(
|
||||||
os.path.join(repodir, version["obbPatchFile"]),
|
os.path.join(repodir, version["obbPatchFile"]),
|
||||||
"sha256", version["obbPatchFileSha256"]
|
version["obbPatchFileSha256"],
|
||||||
)
|
)
|
||||||
|
|
||||||
ver["manifest"] = manifest = {}
|
ver["manifest"] = manifest = {}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue