Do not show ? for packages without build no, it is confusing

This commit is contained in:
Faik Uygur
2009-09-10 12:21:29 +00:00
parent 29ce667433
commit a72a7e4563
2 changed files with 9 additions and 6 deletions
+4 -1
View File
@@ -29,7 +29,10 @@ class PackageInfo:
a_build = [autoxml.String, autoxml.optional]
def __str__(self):
return self.version + "-" + self.release + "-" + (self.build or '?')
if self.build:
return self.version + "-" + self.release + "-" + self.build
else:
return self.version + "-" + self.release
class Repo:
a_operation = [autoxml.String, autoxml.mandatory]
+5 -5
View File
@@ -10,6 +10,7 @@
# Please read the COPYING file.
import os
import exceptions
import gettext
__trans = gettext.translation("pisi", fallback=True)
_ = __trans.ugettext
@@ -28,11 +29,10 @@ def __pkg_already_installed(name, pkginfo):
if not installdb.has_package(name):
return False
ver, rel, build = str(pkginfo).split("-")
if build == '?':
build = None
else:
build = int(build)
verno = str(pkginfo).split("-")
ver, rel = verno[0:2]
build = int(verno[2]) if len(verno) > 2 else None
return (ver, rel, build) == installdb.get_version(name)
def __listactions(actions):