add second search of packages version, if package is older than branch
This commit is contained in:
parent
cb5f3ec98f
commit
78daf7d9bb
13
build.py
13
build.py
@ -92,6 +92,19 @@ def api_get_source_package_version(branch: str, package_name: str) -> str:
|
||||
response = requests.get(api_url, params)
|
||||
if response.status_code != 200:
|
||||
print(response)
|
||||
api_url = "https://rdb.altlinux.org/api/site/package_versions"
|
||||
params = {"arch": "x86_64", "package_type": "source", "name": package_name}
|
||||
response = requests.get(api_url, params)
|
||||
if response.status_code != 200:
|
||||
print(response)
|
||||
raise RuntimeError(
|
||||
f"failed to retrieve source package version: source package {package_name!r}, branch {branch!r} "
|
||||
)
|
||||
result = response.json()
|
||||
for v in result["versions"]:
|
||||
if v["branch"] == branch:
|
||||
return v["version"]
|
||||
|
||||
raise RuntimeError(
|
||||
f"failed to retrieve source package version: source package {package_name!r}, branch {branch!r} "
|
||||
)
|
||||
|
Loading…
x
Reference in New Issue
Block a user