mirror of
https://github.com/RROrg/rr.git
synced 2025-06-21 05:51:05 +08:00
修复 getpats4mv 函数中的 checksum 获取逻辑,确保在缺失时返回默认值 '0' * 32
This commit is contained in:
parent
2ff44c4b1f
commit
2a4eb4996d
@ -234,7 +234,7 @@ def getpats4mv(model, version):
|
||||
if V not in pats:
|
||||
pats[V] = {
|
||||
'url': data['info']['system']['detail'][0]['items'][0]['files'][0]['url'].split('?')[0],
|
||||
'sum': data['info']['system']['detail'][0]['items'][0]['files'][0]['checksum']
|
||||
'sum': data['info']['system']['detail'][0]['items'][0]['files'][0].get('checksum', '0' * 32)
|
||||
}
|
||||
|
||||
from_ver = min(I['build'] for I in data['info']['pubVers'])
|
||||
@ -256,7 +256,7 @@ def getpats4mv(model, version):
|
||||
if V not in pats:
|
||||
pats[V] = {
|
||||
'url': dataTmp['info']['system']['detail'][0]['items'][0]['files'][0]['url'].split('?')[0],
|
||||
'sum': dataTmp['info']['system']['detail'][0]['items'][0]['files'][0]['checksum']
|
||||
'sum': dataTmp['info']['system']['detail'][0]['items'][0]['files'][0].get('checksum', '0' * 32)
|
||||
}
|
||||
|
||||
for J in I['versions']:
|
||||
@ -276,7 +276,7 @@ def getpats4mv(model, version):
|
||||
continue
|
||||
pats[V] = {
|
||||
'url': S['files'][0]['url'].split('?')[0],
|
||||
'sum': S['files'][0]['checksum']
|
||||
'sum': S['files'][0].get('checksum', '0' * 32)
|
||||
}
|
||||
except Exception as e:
|
||||
# click.echo(f"Error: {e}")
|
||||
|
@ -1401,7 +1401,7 @@ function extractDsmFiles() {
|
||||
fi
|
||||
|
||||
printf "$(TEXT "Checking hash of %s:")" "${PAT_FILE}"
|
||||
if [ "$(md5sum "${PAT_PATH}" | awk '{print $1}')" != "${PATSUM}" ]; then
|
||||
if [ "00000000000000000000000000000000" != "${PATSUM}" ] && [ "$(md5sum "${PAT_PATH}" | awk '{print $1}')" != "${PATSUM}" ]; then
|
||||
rm -f "${PAT_PATH}"
|
||||
echo -e "$(TEXT "md5 hash of pat not match, Please reget pat data from the version menu and try again!")" >"${LOG_FILE}"
|
||||
return 1
|
||||
|
@ -151,7 +151,7 @@ def getpats(workpath, jsonpath, xlsxpath):
|
||||
if V not in pats[M]:
|
||||
pats[M][V] = {
|
||||
'url': data['info']['system']['detail'][0]['items'][0]['files'][0]['url'].split('?')[0],
|
||||
'sum': data['info']['system']['detail'][0]['items'][0]['files'][0]['checksum']
|
||||
'sum': data['info']['system']['detail'][0]['items'][0]['files'][0].get('checksum', '0' * 32)
|
||||
}
|
||||
|
||||
from_ver = min(I['build'] for I in data['info']['pubVers'])
|
||||
@ -177,7 +177,7 @@ def getpats(workpath, jsonpath, xlsxpath):
|
||||
if V not in pats[M]:
|
||||
pats[M][V] = {
|
||||
'url': dataTmp['info']['system']['detail'][0]['items'][0]['files'][0]['url'].split('?')[0],
|
||||
'sum': dataTmp['info']['system']['detail'][0]['items'][0]['files'][0]['checksum']
|
||||
'sum': dataTmp['info']['system']['detail'][0]['items'][0]['files'][0].get('checksum', '0' * 32)
|
||||
}
|
||||
|
||||
for J in I['versions']:
|
||||
@ -202,7 +202,7 @@ def getpats(workpath, jsonpath, xlsxpath):
|
||||
continue
|
||||
pats[M][V] = {
|
||||
'url': S['files'][0]['url'].split('?')[0],
|
||||
'sum': S['files'][0]['checksum']
|
||||
'sum': S['files'][0].get('checksum', '0' * 32)
|
||||
}
|
||||
|
||||
if jsonpath:
|
||||
|
Loading…
x
Reference in New Issue
Block a user