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] a_build = [autoxml.String, autoxml.optional]
def __str__(self): 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: class Repo:
a_operation = [autoxml.String, autoxml.mandatory] a_operation = [autoxml.String, autoxml.mandatory]
+5 -5
View File
@@ -10,6 +10,7 @@
# Please read the COPYING file. # Please read the COPYING file.
import os import os
import exceptions
import gettext import gettext
__trans = gettext.translation("pisi", fallback=True) __trans = gettext.translation("pisi", fallback=True)
_ = __trans.ugettext _ = __trans.ugettext
@@ -28,11 +29,10 @@ def __pkg_already_installed(name, pkginfo):
if not installdb.has_package(name): if not installdb.has_package(name):
return False return False
ver, rel, build = str(pkginfo).split("-") verno = str(pkginfo).split("-")
if build == '?': ver, rel = verno[0:2]
build = None build = int(verno[2]) if len(verno) > 2 else None
else:
build = int(build)
return (ver, rel, build) == installdb.get_version(name) return (ver, rel, build) == installdb.get_version(name)
def __listactions(actions): def __listactions(actions):