remove feature added view version

This commit is contained in:
Dimitris Zlatanidis 2015-05-17 02:53:20 +03:00
parent 1e17a6b2d7
commit 2fe6b6a0d0
3 changed files with 12 additions and 40 deletions

View file

@ -227,16 +227,6 @@ class BinaryInstall(object):
if not self.if_upgrade:
self.pkg_ver = [''] * len(packages)
def package_ver(self, package):
'''
Return package version if package already installed
'''
name = "-".join(package[:-4].split("-")[:-3]) + "-"
pkg = "".join(find_package(name, _m.pkg_path)[0])
if pkg:
return split_package(pkg)[1]
return ""
def views(self, install, comp_sum, is_deps):
'''
Views packages
@ -250,11 +240,9 @@ class BinaryInstall(object):
for pkg, ver, comp in zip(install, self.pkg_ver, comp_sum):
pkg_split = split_package(pkg[:-4])
if find_package(pkg[:-4], _m.pkg_path):
ver = '-' + self.package_ver(pkg)
pkg_sum += 1
COLOR = _m.color['GREEN']
elif find_package(pkg_split[0] + "-", _m.pkg_path):
ver = '-' + self.package_ver(pkg)
COLOR = _m.color['YELLOW']
upg_sum += 1
else:

View file

@ -66,6 +66,7 @@ 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])
@ -100,13 +101,13 @@ class SBoInstall(object):
self.top_view()
Msg().upg_inst(self.if_upgrade)
# view master packages
for sbo, ar in zip(self.master_packages, mas_src):
for sbo, ver, ar in zip(self.master_packages, self.pkg_ver,
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 ver:
name = name[:-1]
if not if_upgrade:
name = '-'.join(sbo.split('-')[:-1])
self.view_packages(tagc, name, sbo.split('-')[-1],
self.select_arch(ar))
self._view_installing_for_deps()
@ -114,10 +115,7 @@ 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)
ver = self.package_ver(dep)
name = '-'.join(dep.split('-')[:-1]) + '-' + ver
if not ver:
name = name[:-1]
name = '-'.join(dep.split('-')[:-1])
self.view_packages(tagc, name, dep.split('-')[-1],
self.select_arch(ar))
count_total = (count_ins + count_upg + count_uni)
@ -228,14 +226,12 @@ class SBoInstall(object):
"Size"))
Msg().template(78)
def package_ver(self, sbo):
def view_version(self):
'''
Return package version if package already installed
Create empty seats if not upgrade
'''
pkg = "".join(find_package(sbo.split("-")[0] + "-", _m.pkg_path))
if pkg:
return split_package(pkg)[1]
return ""
if not self.if_upgrade:
self.pkg_ver = [''] * len(self.slackbuilds)
def view_packages(self, *args):
'''
@ -267,7 +263,6 @@ class SBoInstall(object):
else:
paint = _m.color['RED']
count_uni += 1
return paint, count_ins, count_upg, count_uni
def select_arch(self, src):

View file

@ -145,16 +145,6 @@ class Patches(object):
self.count_added += 1
self.count_upg -= 1
def package_ver(self, package):
'''
Return package version if package already installed
'''
name = "-".join(package[:-4].split("-")[:-3]) + "-"
pkg = "".join(find_package(name, _m.pkg_path)[0])
if pkg:
return split_package(pkg)[1]
return ""
def views(self):
'''
Views packages
@ -162,12 +152,11 @@ class Patches(object):
for upg, size in sorted(zip(self.upgrade_all, self.comp_sum)):
pkg_split = split_package(upg[:-4])
color = _m.color['YELLOW']
ver = "-" + self.package_ver(upg)
if not find_package(pkg_split[0], _m.pkg_path):
color = _m.color['RED']
print(" {0}{1}{2}{3} {4}{5} {6}{7}{8}{9}{10}{11:>12}{12}".format(
color, pkg_split[0] + ver, _m.color['ENDC'],
" " * (24-len(pkg_split[0] + ver)), pkg_split[1],
color, pkg_split[0], _m.color['ENDC'],
" " * (24-len(pkg_split[0])), pkg_split[1],
" " * (18-len(pkg_split[1])), pkg_split[2],
" " * (8-len(pkg_split[2])), pkg_split[3],
" " * (7-len(pkg_split[3])), "Slack",