Correzione di un paio di problemi del codice.
This commit is contained in:
parent
ab26e0aa32
commit
14ac61fc92
|
@ -171,7 +171,6 @@ class Build():
|
||||||
# was already built.
|
# was already built.
|
||||||
name = self.appimagefilename
|
name = self.appimagefilename
|
||||||
url = self.storage_path.rstrip('/') + self.full_path + '/'
|
url = self.storage_path.rstrip('/') + self.full_path + '/'
|
||||||
matching = []
|
|
||||||
try:
|
try:
|
||||||
if len(loaih.match_xpath(url, f"//a[contains(@href,'{name}')]/@href")) > 0:
|
if len(loaih.match_xpath(url, f"//a[contains(@href,'{name}')]/@href")) > 0:
|
||||||
# Already built.
|
# Already built.
|
||||||
|
@ -183,8 +182,6 @@ class Build():
|
||||||
|
|
||||||
else:
|
else:
|
||||||
# Repo is local
|
# Repo is local
|
||||||
|
|
||||||
|
|
||||||
command = f"find {self.full_path} -name {self.appimagefilename}"
|
command = f"find {self.full_path} -name {self.appimagefilename}"
|
||||||
res = subprocess.run(shlex.split(command),
|
res = subprocess.run(shlex.split(command),
|
||||||
capture_output=True,
|
capture_output=True,
|
||||||
|
@ -473,10 +470,10 @@ class Build():
|
||||||
|
|
||||||
# On the contrary, we will dump a logfile, remove the download and
|
# On the contrary, we will dump a logfile, remove the download and
|
||||||
# redo the download.
|
# redo the download.
|
||||||
with open(os.path.join(self.downloadpath, 'downloadfailure.log'), 'wa') as logfile:
|
with open(os.path.join(self.download_path, 'downloadfailure.log'), 'wa') as logfile:
|
||||||
logfile.write(f"{timenow.isoformat()};{resource.url};{mimetype}")
|
logfile.write(f"{timenow.isoformat()};{resource.url};{mimetype}")
|
||||||
|
|
||||||
file.unlink(testedfilename)
|
os.unlink(testedfilename)
|
||||||
break_control += 1
|
break_control += 1
|
||||||
|
|
||||||
# If it arrives here, 5 attempts to download the archive have failed.
|
# If it arrives here, 5 attempts to download the archive have failed.
|
||||||
|
@ -500,7 +497,7 @@ class Build():
|
||||||
file.write(chunk)
|
file.write(chunk)
|
||||||
return filename
|
return filename
|
||||||
|
|
||||||
def __download_debug__(self, url: str, filename: str) -> (str, requests.Response):
|
def __download_debug__(self, url: str, filename: str) -> tuple[str, requests.Response]:
|
||||||
basename = filename
|
basename = filename
|
||||||
if '/' in filename:
|
if '/' in filename:
|
||||||
basename = filename.split('/')[-1]
|
basename = filename.split('/')[-1]
|
||||||
|
@ -515,7 +512,7 @@ class Build():
|
||||||
with open(filename, 'wb') as file:
|
with open(filename, 'wb') as file:
|
||||||
for chunk in resource.iter_content(chunk_size=8192):
|
for chunk in resource.iter_content(chunk_size=8192):
|
||||||
file.write(chunk)
|
file.write(chunk)
|
||||||
return (filename, resource)
|
return filename, resource
|
||||||
|
|
||||||
def __select_tarballs__(self):
|
def __select_tarballs__(self):
|
||||||
retval = [ self.tarballs[0] ]
|
retval = [ self.tarballs[0] ]
|
||||||
|
@ -698,7 +695,7 @@ class Build():
|
||||||
), cwd=temporary, check=True)
|
), cwd=temporary, check=True)
|
||||||
|
|
||||||
if self.debug:
|
if self.debug:
|
||||||
with open(os.path.abspath(os.storage_path, 'dependencies.lst'), 'w', encoding="utf-8") as deplist:
|
with open(os.path.abspath(os.path.join(self.storage_path, 'dependencies.lst')), 'w', encoding="utf-8") as deplist:
|
||||||
deplist.write("\n".join(debs))
|
deplist.write("\n".join(debs))
|
||||||
|
|
||||||
def __finalize_build__(self):
|
def __finalize_build__(self):
|
||||||
|
|
Loading…
Reference in New Issue