From 1226d910f77801e619c9f62f7ac016b8e9a0c914 Mon Sep 17 00:00:00 2001 From: Faik Uygur Date: Mon, 8 Sep 2008 07:03:21 +0000 Subject: [PATCH] Add Requires tag to Update with actions: reverseDependencyUpdate serviceRestart systemRestart Example: 2008-08-27 0.28.3 Version bump Faik Uygur faik@pardus.org.tr revDepUpdates systemRestart serviceRestart Requires is optional. An Action is mandatory. --- pisi/operations/upgrade.py | 6 ++++-- pisi/specfile.py | 11 ++++++++++- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/pisi/operations/upgrade.py b/pisi/operations/upgrade.py index b8a10872..c7b49dc3 100644 --- a/pisi/operations/upgrade.py +++ b/pisi/operations/upgrade.py @@ -71,11 +71,14 @@ def upgrade_pkg_names(A = []): ctx.ui.info(_('Package %s is not available in repositories.') % x, True) continue + updates = [i for i in pkg.history if pisi.version.Version(i.release) > pisi.version.Version(release)] if security_only: - updates = [i for i in pkg.history if pisi.version.Version(i.release) > pisi.version.Version(release)] if not pisi.util.any(lambda i:i.type == 'security', updates): continue + if pisi.util.any(lambda x:x.requires and "reverseDependencyUpdate" in x.requires.action, updates): + Ap.extend(map(lambda d:d.package, packagedb.get_rev_deps(x))) + if ignore_build or (not build) or (not pkg.build): if pisi.version.Version(release) < pisi.version.Version(pkg.release): Ap.append(x) @@ -89,7 +92,6 @@ def upgrade_pkg_names(A = []): ctx.ui.info(_('Package %s is already at the latest build %s.') % (pkg.name, pkg.build), True) - A = set(Ap) if len(A)==0: diff --git a/pisi/specfile.py b/pisi/specfile.py index 9e74ef64..c63b4968 100644 --- a/pisi/specfile.py +++ b/pisi/specfile.py @@ -83,6 +83,15 @@ class Patch: s += ' level:' + self.level return s +class Requires: + + # Valid actions: + # + # reverseDependencyUpdate + # systemRestart + # serviceRestart + + t_Action = [ [autoxml.String], autoxml.mandatory] class Update: @@ -93,6 +102,7 @@ class Update: t_Comment = [autoxml.String, autoxml.optional] t_Name = [autoxml.Text, autoxml.optional] t_Email = [autoxml.String, autoxml.optional] + t_Requires = [Requires, autoxml.optional] def __str__(self): s = self.date @@ -102,7 +112,6 @@ class Update: s += ", type=" + self.type return s - class Path: s_Path = [autoxml.String, autoxml.mandatory]