Feature added print installed version

This commit is contained in:
Dimitris Zlatanidis 2015-06-12 08:17:09 +03:00
parent 623d28776d
commit 6d03b1d41c
2 changed files with 22 additions and 4 deletions

View file

@ -233,15 +233,24 @@ class BinaryInstall(object):
else:
COLOR = self.meta.color["RED"]
uni_sum += 1
ver = self.get_installed_version(pkg_split[0])
print(" {0}{1}{2}{3} {4}{5} {6}{7}{8}{9}{10}{11:>11}{12}".format(
COLOR, pkg_split[0], self.meta.color["ENDC"],
" " * (24-len(pkg_split[0])), pkg_split[1],
COLOR, pkg_split[0] + ver, self.meta.color["ENDC"],
" " * (24-len(pkg_split[0] + ver)), pkg_split[1],
" " * (18-len(pkg_split[1])), pkg_split[2],
" " * (8-len(pkg_split[2])), pkg_split[3],
" " * (7-len(pkg_split[3])), repo,
comp, " K")).rstrip()
return [pkg_sum, upg_sum, uni_sum]
def get_installed_version(self, package):
"""Get installed package version
"""
find = find_package(package + self.meta.sp, self.meta.pkg_path)
if find:
return self.meta.sp + split_package(find[0])[1]
return ""
def top_view(self):
Msg().template(78)
print("{0}{1}{2}{3}{4}{5}{6}{7}{8}{9}{10}".format(

View file

@ -228,13 +228,22 @@ class SBoInstall(object):
args[2] version
args[3] arch
"""
ver = self.get_installed_version(args[1])
print(" {0}{1}{2}{3} {4}{5} {6}{7}{8}{9}{10}{11:>11}{12}".format(
args[0], args[1], self.meta.color["ENDC"],
" " * (24-len(args[1])), args[2],
args[0], args[1] + ver, self.meta.color["ENDC"],
" " * (24-len(args[1] + ver)), args[2],
" " * (18-len(args[2])), args[3],
" " * (15-len(args[3])), "",
"", "SBo", "", "")).rstrip()
def get_installed_version(self, package):
"""Get installed package version
"""
find = find_package(package + self.meta.sp, self.meta.pkg_path)
if find:
return self.meta.sp + split_package(find[0])[1]
return ""
def tag(self, sbo, count_ins, count_upg, count_uni):
"""
Tag with color green if package already installed,