mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2024-12-31 10:26:39 +01:00
Converted to generator
Signed-off-by: Dimitris Zlatanidis <d.zlatanidis@gmail.com>
This commit is contained in:
parent
9504228619
commit
2fc4f64036
1 changed files with 5 additions and 8 deletions
|
@ -312,10 +312,8 @@ class SBoInstall:
|
|||
def filenames(self, sources):
|
||||
"""Return filenames from sources links
|
||||
"""
|
||||
filename = []
|
||||
for src in sources:
|
||||
filename.append(src.split("/")[-1])
|
||||
return filename
|
||||
yield src.split("/")[-1]
|
||||
|
||||
def build_install(self):
|
||||
"""Build and install packages if not already installed
|
||||
|
@ -348,13 +346,14 @@ class SBoInstall:
|
|||
sbo_link = SBoLink(sbo_url).tar_gz()
|
||||
script = sbo_link.split("/")[-1]
|
||||
if self.meta.sbosrcarch in ["on", "ON"]:
|
||||
src_link = self.sbosrcarsh(prgnam, sbo_link, src_link)
|
||||
src_link = list(self.sbosrcarsh(prgnam, sbo_link, src_link))
|
||||
Download(self.build_folder, sbo_link.split(),
|
||||
repo="sbo").start()
|
||||
Download(self._SOURCES, src_link, repo="sbo").start()
|
||||
if "--download-only" in self.flag:
|
||||
continue
|
||||
sources = self.filenames(src_link)
|
||||
sources = list(self.filenames(src_link))
|
||||
print(sources)
|
||||
BuildPackage(script, sources, self.build_folder,
|
||||
auto=False).build()
|
||||
binary = slack_package(prgnam)
|
||||
|
@ -389,10 +388,8 @@ class SBoInstall:
|
|||
|
||||
def sbosrcarsh(self, prgnam, sbo_link, src_link):
|
||||
"""Alternative repository for sbo sources"""
|
||||
sources = []
|
||||
name = "-".join(prgnam.split("-")[:-1])
|
||||
category = f"{sbo_link.split('/')[-2]}/{name}/"
|
||||
for link in src_link:
|
||||
source = link.split("/")[-1]
|
||||
sources.append(f"{self.meta.sbosrcarch_link}{category}{source}")
|
||||
return sources
|
||||
yield f"{self.meta.sbosrcarch_link}{category}{source}"
|
||||
|
|
Loading…
Reference in a new issue