Look at deleted packages if they are not found
This commit is contained in:
23
lib/obs.py
23
lib/obs.py
@@ -148,12 +148,21 @@ class OBS:
|
|||||||
]
|
]
|
||||||
|
|
||||||
def _download(self, project, package, name, revision):
|
def _download(self, project, package, name, revision):
|
||||||
url = osc.core.makeurl(
|
try:
|
||||||
self.url,
|
url = osc.core.makeurl(
|
||||||
["source", project, package, name],
|
self.url,
|
||||||
{"rev": revision, "expand": 1},
|
["source", project, package, name],
|
||||||
)
|
{"rev": revision, "expand": 1},
|
||||||
return osc.core.http_GET(url)
|
)
|
||||||
|
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(
|
def download(
|
||||||
self,
|
self,
|
||||||
@@ -189,7 +198,7 @@ class OBS:
|
|||||||
try:
|
try:
|
||||||
root = self._xml(f"source/{project}/{package}", **params)
|
root = self._xml(f"source/{project}/{package}", **params)
|
||||||
except HTTPError as e:
|
except HTTPError as e:
|
||||||
if e.code == 400:
|
if e.code == 400 or e.code == 404:
|
||||||
logging.error(
|
logging.error(
|
||||||
f"Package [{project}/{package} {params}] can't be expanded: {e}"
|
f"Package [{project}/{package} {params}] can't be expanded: {e}"
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user