Kaydet (Commit) d1b73dd5 authored tarafından Fatih Aşıcı's avatar Fatih Aşıcı

installdb: Remove buildno-related stuff

üst 4a7d58c5
......@@ -75,8 +75,8 @@ Usage: list-installed
maxlen = max([len(_p) for _p in installed])
if self.options.install_info:
ctx.ui.info(_('Package Name |St| Version| Rel.| Build| Distro| Date'))
print '========================================================================'
ctx.ui.info(_('Package Name |St| Version| Rel.| Distro| Date'))
print '==========================================================================='
for pkg in installed:
package = self.installdb.get_package(pkg)
inst_info = self.installdb.get_info(pkg)
......@@ -84,7 +84,7 @@ Usage: list-installed
ctx.ui.info(unicode(package))
ctx.ui.info(unicode(inst_info))
elif self.options.install_info:
ctx.ui.info('%-15s |%s' % (package.name, inst_info.one_liner()))
ctx.ui.info('%-20s |%s' % (package.name, inst_info.one_liner()))
else:
package.name = package.name + ' ' * (maxlen - len(package.name))
ctx.ui.info('%s - %s' % (package.name, unicode(package.summary)))
......@@ -70,8 +70,8 @@ Lists the packages that will be upgraded.
maxlen = max([len(_p) for _p in upgradable_pkgs])
if self.options.install_info:
ctx.ui.info(_('Package Name |St| Version| Rel.| Build| Distro| Date'))
print '========================================================================'
ctx.ui.info(_('Package Name |St| Version| Rel.| Distro| Date'))
print '==========================================================================='
for pkg in upgradable_pkgs:
package = self.installdb.get_package(pkg)
inst_info = self.installdb.get_info(pkg)
......@@ -79,7 +79,7 @@ Lists the packages that will be upgraded.
ctx.ui.info(package)
print inst_info
elif self.options.install_info:
ctx.ui.info('%-15s | %s ' % (package.name, inst_info.one_liner()))
ctx.ui.info('%-20s |%s ' % (package.name, inst_info.one_liner()))
else:
package.name = package.name + ' ' * (maxlen - len(package.name))
ctx.ui.info('%s - %s' % (package.name, unicode(package.summary)))
......@@ -36,26 +36,23 @@ class InstallInfo:
state_map = { 'i': _('installed'), 'ip':_('installed-pending') }
def __init__(self, state, version, release, build, distribution, time):
def __init__(self, state, version, release, distribution, time):
self.state = state
self.version = version
self.release = release
self.build = build
self.distribution = distribution
self.time = time
def one_liner(self):
import time
time_str = time.strftime("%d %b %Y %H:%M", self.time)
s = '%2s|%10s|%6s|%6s|%8s|%12s' % (self.state, self.version, self.release,
self.build, self.distribution,
time_str)
s = '%2s|%15s|%6s|%8s|%12s' % (self.state, self.version, self.release,
self.distribution, time_str)
return s
def __str__(self):
s = _("State: %s\nVersion: %s, Release: %s, Build: %s\n") % \
(InstallInfo.state_map[self.state], self.version,
self.release, self.build)
s = _("State: %s\nVersion: %s, Release: %s\n") % \
(InstallInfo.state_map[self.state], self.version, self.release)
import time
time_str = time.strftime("%d %b %Y %H:%M", self.time)
s += _('Distribution: %s, Install Time: %s\n') % (self.distribution,
......@@ -135,11 +132,11 @@ class InstallDB(lazydb.LazyDB):
def __get_version(self, meta_doc):
history = meta_doc.getTag("Package").getTag("History")
build = meta_doc.getTag("Package").getTagData("Build")
version = history.getTag("Update").getTagData("Version")
release = history.getTag("Update").getAttribute("release")
return version, release, build and int(build)
# TODO Remove None
return version, release, None
def __get_distro_release(self, meta_doc):
distro = meta_doc.getTag("Package").getTagData("Distribution")
......@@ -215,7 +212,6 @@ class InstallDB(lazydb.LazyDB):
info = InstallInfo(state,
pkg.version,
pkg.release,
pkg.build,
pkg.distribution,
ctime)
return info
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment