diff --git a/slpkg/sbo/slackbuild.py b/slpkg/sbo/slackbuild.py index da3905cc..2b32931a 100644 --- a/slpkg/sbo/slackbuild.py +++ b/slpkg/sbo/slackbuild.py @@ -66,7 +66,6 @@ class SBoInstall(object): def start(self, if_upgrade): try: self.if_upgrade = if_upgrade - self.view_version() if self.if_upgrade: self.slackbuilds, self.pkg_ver = (self.slackbuilds[0], self.slackbuilds[1]) @@ -101,13 +100,13 @@ class SBoInstall(object): self.top_view() Msg().upg_inst(self.if_upgrade) # view master packages - for sbo, ver, ar in zip(self.master_packages, self.pkg_ver, - mas_src): + for sbo, ar in zip(self.master_packages, mas_src): tagc, count_ins, count_upg, count_uni = self.tag( sbo, count_ins, count_upg, count_uni) + ver = self.package_ver(sbo) name = '-'.join(sbo.split('-')[:-1]) + '-' + ver - if not if_upgrade: - name = '-'.join(sbo.split('-')[:-1]) + if not ver: + name = name[:-1] self.view_packages(tagc, name, sbo.split('-')[-1], self.select_arch(ar)) self._view_installing_for_deps() @@ -115,7 +114,10 @@ class SBoInstall(object): for dep, ar in zip(self.dependencies, dep_src): tagc, count_ins, count_upg, count_uni = self.tag( dep, count_ins, count_upg, count_uni) - name = '-'.join(dep.split('-')[:-1]) + ver = self.package_ver(dep) + name = '-'.join(dep.split('-')[:-1]) + '-' + ver + if not ver: + name = name[:-1] self.view_packages(tagc, name, dep.split('-')[-1], self.select_arch(ar)) count_total = (count_ins + count_upg + count_uni) @@ -226,12 +228,14 @@ class SBoInstall(object): "Size")) Msg().template(78) - def view_version(self): + def package_ver(self, sbo): ''' - Create empty seats if not upgrade + Return package version if package exist ''' - if not self.if_upgrade: - self.pkg_ver = [''] * len(self.slackbuilds) + pkg = "".join(find_package(sbo.split("-")[0] + "-", _m.pkg_path)) + if pkg: + return split_package(pkg)[1] + return "" def view_packages(self, *args): ''' @@ -263,6 +267,7 @@ class SBoInstall(object): else: paint = _m.color['RED'] count_uni += 1 + return paint, count_ins, count_upg, count_uni def select_arch(self, src):