Look at deleted packages if they are not found

This commit is contained in:
2025-07-24 13:20:00 +02:00
parent 5d55a8c2fe
commit 5a6a55868f

View File

@@ -148,12 +148,21 @@ class OBS:
]
def _download(self, project, package, name, revision):
url = osc.core.makeurl(
self.url,
["source", project, package, name],
{"rev": revision, "expand": 1},
)
return osc.core.http_GET(url)
try:
url = osc.core.makeurl(
self.url,
["source", project, package, name],
{"rev": revision, "expand": 1},
)
return osc.core.http_GET(url)
except HTTPError as e:
if e.status == 404:
url = osc.core.makeurl(
self.url,
["source", project, package, name],
{"rev": revision, "expand": 1, "deleted": 1},
)
return osc.core.http_GET(url)
def download(
self,
@@ -189,7 +198,7 @@ class OBS:
try:
root = self._xml(f"source/{project}/{package}", **params)
except HTTPError as e:
if e.code == 400:
if e.code == 400 or e.code == 404:
logging.error(
f"Package [{project}/{package} {params}] can't be expanded: {e}"
)