From 9c58fa9b394ba88aacab0c9c3b4619d5ffa7b3c4 Mon Sep 17 00:00:00 2001 From: Faik Uygur Date: Thu, 10 Sep 2009 13:03:18 +0000 Subject: [PATCH] onur is using this, and finds it helpfull revert for now --- pisi/history.py | 5 +---- pisi/operations/history.py | 10 +++++----- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/pisi/history.py b/pisi/history.py index 5bc3c3c4..283fc553 100644 --- a/pisi/history.py +++ b/pisi/history.py @@ -29,10 +29,7 @@ class PackageInfo: a_build = [autoxml.String, autoxml.optional] def __str__(self): - if self.build: - return self.version + "-" + self.release + "-" + self.build - else: - return self.version + "-" + self.release + return self.version + "-" + self.release + "-" + (self.build or '?') class Repo: a_operation = [autoxml.String, autoxml.mandatory] diff --git a/pisi/operations/history.py b/pisi/operations/history.py index 006081fe..5ebd157a 100644 --- a/pisi/operations/history.py +++ b/pisi/operations/history.py @@ -10,7 +10,6 @@ # Please read the COPYING file. import os -import exceptions import gettext __trans = gettext.translation("pisi", fallback=True) _ = __trans.ugettext @@ -29,10 +28,11 @@ def __pkg_already_installed(name, pkginfo): if not installdb.has_package(name): return False - verno = str(pkginfo).split("-") - ver, rel = verno[0:2] - build = int(verno[2]) if len(verno) > 2 else None - + ver, rel, build = str(pkginfo).split("-") + if build == '?': + build = None + else: + build = int(build) return (ver, rel, build) == installdb.get_version(name) def __listactions(actions):