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: if not self.if_upgrade:
self.pkg_ver = [''] * len(packages) 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): def views(self, install, comp_sum, is_deps):
''' '''
Views packages Views packages
@ -250,11 +240,9 @@ class BinaryInstall(object):
for pkg, ver, comp in zip(install, self.pkg_ver, comp_sum): for pkg, ver, comp in zip(install, self.pkg_ver, comp_sum):
pkg_split = split_package(pkg[:-4]) pkg_split = split_package(pkg[:-4])
if find_package(pkg[:-4], _m.pkg_path): if find_package(pkg[:-4], _m.pkg_path):
ver = '-' + self.package_ver(pkg)
pkg_sum += 1 pkg_sum += 1
COLOR = _m.color['GREEN'] COLOR = _m.color['GREEN']
elif find_package(pkg_split[0] + "-", _m.pkg_path): elif find_package(pkg_split[0] + "-", _m.pkg_path):
ver = '-' + self.package_ver(pkg)
COLOR = _m.color['YELLOW'] COLOR = _m.color['YELLOW']
upg_sum += 1 upg_sum += 1
else: else:

View file

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

View file

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