mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2025-01-18 10:26:29 +01:00
Fix build error message
This commit is contained in:
parent
68f74c0137
commit
830e795a67
4 changed files with 15 additions and 6 deletions
|
@ -31,6 +31,8 @@ import tarfile
|
|||
import subprocess
|
||||
import multiprocessing
|
||||
|
||||
from find import find_package
|
||||
|
||||
from slpkg.messages import Msg
|
||||
from slpkg.checksum import check_md5
|
||||
from slpkg.__metadata__ import MetaData as _meta_
|
||||
|
@ -101,12 +103,21 @@ class BuildPackage(object):
|
|||
subprocess.call("{0} ./{1}.SlackBuild".format(
|
||||
" ".join(pass_var), self.prgnam, shell=True))
|
||||
os.chdir(self.path)
|
||||
self._check_if_build()
|
||||
except (OSError, IOError):
|
||||
Msg().pkg_not_found("\n", self.prgnam, "Wrong file", "\n")
|
||||
except KeyboardInterrupt:
|
||||
print("") # new line at exit
|
||||
raise SystemExit()
|
||||
|
||||
def _check_if_build(self):
|
||||
"""Check if package build normal in /tmp directory
|
||||
"""
|
||||
find = find_package(self.prgnam + self.meta.sp, self.meta.output)
|
||||
if not find:
|
||||
Msg().build_FAILED(self.prgnam)
|
||||
raise SystemExit()
|
||||
|
||||
def _create_md5_dict(self):
|
||||
"""Create md5 dictionary per source
|
||||
"""
|
||||
|
|
|
@ -53,6 +53,8 @@ class PackageManager(object):
|
|||
check = pkg[:-4].split("/")[-1]
|
||||
if os.path.isfile(self.meta.pkg_path + check):
|
||||
print("Completed!\n")
|
||||
else:
|
||||
raise SystemExit()
|
||||
except (subprocess.CalledProcessError, KeyboardInterrupt):
|
||||
self._not_found("Can't install", self.binary, pkg)
|
||||
|
||||
|
@ -66,6 +68,8 @@ class PackageManager(object):
|
|||
check = pkg[:-4].split("/")[-1]
|
||||
if os.path.isfile(self.meta.pkg_path + check):
|
||||
print("Completed!\n")
|
||||
else:
|
||||
raise SystemExit()
|
||||
except (subprocess.CalledProcessError, KeyboardInterrupt):
|
||||
self._not_found("Can't upgrade", self.binary, pkg)
|
||||
|
||||
|
|
|
@ -277,9 +277,6 @@ class SBoInstall(object):
|
|||
arch = "arm"
|
||||
package = "{0}-{1}-{2}_SBo".format(prgnam, arch, build_N)
|
||||
find = find_package(package, self.meta.output)
|
||||
if not find:
|
||||
Msg().build_FAILED(prgnam)
|
||||
raise SystemExit()
|
||||
return ["".join([self.meta.output] + find)]
|
||||
|
||||
def build_install(self):
|
||||
|
|
|
@ -223,9 +223,6 @@ class SBoNetwork(object):
|
|||
package = "{0}-{1}-{2}_SBo".format(
|
||||
prgnam, arch, BuildNumber(sbo_url="", pkg=self.name).get())
|
||||
find = find_package(package, self.meta.output)
|
||||
if not find:
|
||||
Msg().build_FAILED(prgnam)
|
||||
raise SystemExit()
|
||||
binary = ["".join([self.meta.output] + find)]
|
||||
print("[ {0}Installing{1} ] --> {2}".format(self.green,
|
||||
self.endc,
|
||||
|
|
Loading…
Reference in a new issue