From a4b3b4d7445d8352531db277f8ed4e1f4c731bc2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eray=20=C3=96zkural?= Date: Mon, 15 Aug 2005 17:45:31 +0000 Subject: [PATCH] * install isinin icine build no katmayla ilgili calismalar devam --- pisi/cli/commands.py | 1 - pisi/install.py | 20 ++++++++++++++++++-- pisi/toplevel.py | 10 ++++++++-- 3 files changed, 26 insertions(+), 5 deletions(-) diff --git a/pisi/cli/commands.py b/pisi/cli/commands.py index 7e55e1de..eddc4aaa 100644 --- a/pisi/cli/commands.py +++ b/pisi/cli/commands.py @@ -348,7 +348,6 @@ class Info(Command): Usage: info ... -TODO: Some description """ def __init__(self): super(Info, self).__init__() diff --git a/pisi/install.py b/pisi/install.py index 8f3d4c69..b6eb9d09 100644 --- a/pisi/install.py +++ b/pisi/install.py @@ -83,7 +83,6 @@ class Installer: ' not satisfied\n') raise InstallError("Package not installable") - # FIXME: where is build no? def reinstall(self): "check reinstall, confirm action, and remove package if reinstall" @@ -92,7 +91,18 @@ class Installer: if installdb.is_installed(pkg.name): # is this a reinstallation? (iversion, irelease, ibuild) = installdb.get_version(pkg.name) - if pkg.version == iversion and pkg.release == irelease: + # determine if same version + same_ver = False + ignore_build = config.options and config.options.ignore_build_no + if (not ibuild) or (not pkg.build) or ignore_build: + # we don't look at builds to compare two package versions + if pkg.version == iversion and pkg.release == irelease: + same_ver = True + else: + if pkg.build == ibuild: + same_ver = True + + if same_ver: if self.ask_reinstall: if not ui.confirm('Re-install same version package?'): raise InstallError('Package re-install declined') @@ -106,6 +116,10 @@ class Installer: elif pkg.release > irelease: ui.info('Upgrading to new distribution release\n') upgrade = True + elif ((not ignore_build) and ibuild and pkg.build + and pkg.build > ibuild): + ui.info('Upgrading to new distribution build\n') + upgrade = True # is this a downgrade? confirm this action. if self.ask_reinstall and (not upgrade): @@ -113,6 +127,8 @@ class Installer: x = 'Downgrade to old upstream version?' elif pkg.release < irelease: x = 'Downgrade to old distribution release?' + else: + x = 'Downgrade to old distribution build?' if not ui.confirm(x): raise InstallError('Package downgrade declined') diff --git a/pisi/toplevel.py b/pisi/toplevel.py index cb6b7064..114212a4 100644 --- a/pisi/toplevel.py +++ b/pisi/toplevel.py @@ -208,6 +208,8 @@ def upgrade(A): def upgrade_pkg_names(A): """Re-installs packages from the repository, trying to perform a maximum number of upgrades.""" + + ignore_build = config.options and config.options.ignore_build_no # filter packages that are not installed Ap = [] @@ -217,7 +219,7 @@ def upgrade_pkg_names(A): continue (version, release, build) = installdb.get_version(x) pkg = packagedb.get_package(x) - if (config.options and config.options.ignore_build_no) or (not build): + if ignore_build or (not build): if release < pkg.release: Ap.append(x) elif build < pkg.build: @@ -260,7 +262,11 @@ def upgrade_pkg_names(A): rep_pkg = packagedb.get_package(dep.package) (vp,rp,bp) = (rep_pkg.version, rep_pkg.release, rep_pkg.build) - if r >= rp: # installed already older + if ignore_build or (not b) or (not bp): + # if we can't look at build + if r >= rp: # installed already new + continue + elif b and bp and b >= bp: continue if not dep.package in G_f.vertices(): Bp.add(str(dep.package))