Gestito errore di verifica delle build con cartella quando non trovate.

This commit is contained in:
Emiliano Vavassori 2023-01-07 02:23:34 +01:00
parent 64effab3d7
commit db01651251
1 changed files with 12 additions and 7 deletions

View File

@ -159,14 +159,19 @@ class Build(loaih.RemoteBuild):
path = str.join('/', path_arr)
print(f"DEBUG - Name: {name}, URL: {path}")
matching = []
with urllib.request.urlopen(path) as url:
matching = etree.HTML(url.read()).xpath(
f"//a[contains(@href, '{name}')]/@href"
)
try:
with urllib.request.urlopen(path) as url:
matching = etree.HTML(url.read()).xpath(
f"//a[contains(@href, '{name}')]/@href"
)
if len(matching) > 0:
# Already built.
self.built[arch] = True
if len(matching) > 0:
# Already built.
self.built[arch] = True
except urllib.error.HTTPError:
# The URL specified do not exist. So it is to build.
pass
else:
# Repo is local