* Fix optional and mandatory problem of <Requires> <Action> tags when pisi.spec.SpecFile is used.

Actually code was wrong.. 

* Added a helper to find reverseDependencyUpdate in any of the updates to make the code readable
This commit is contained in:
Faik Uygur
2008-12-23 13:08:02 +00:00
parent e11178875e
commit 11fe68eea3
2 changed files with 21 additions and 12 deletions
+1 -1
View File
@@ -71,7 +71,7 @@ def find_upgrades(packages, replaces):
if not pisi.util.any(lambda i:i.type == 'security', updates):
continue
if pisi.util.any(lambda x:x.requires != None and "reverseDependencyUpdate" in x.requires.action, updates):
if pisi.util.any(lambda u:"reverseDependencyUpdate" in u.required_actions() , updates):
Ap.extend(map(lambda d:d[0], packagedb.get_rev_deps(u_pkg)))
if ignore_build or (not build) or (not pkg.build):
+20 -11
View File
@@ -64,6 +64,19 @@ class AdditionalFile:
s += '(%s)' % self.permission
return s
class Action:
# Valid actions:
#
# reverseDependencyUpdate
# systemRestart
# serviceRestart
s_action = [autoxml.String, autoxml.mandatory]
def __str__(self):
return self.action
class Patch:
s_Filename = [autoxml.String, autoxml.mandatory]
@@ -83,16 +96,6 @@ class Patch:
s += ' level:' + self.level
return s
class Requires:
# Valid actions:
#
# reverseDependencyUpdate
# systemRestart
# serviceRestart
t_Action = [ [autoxml.String], autoxml.mandatory]
class Update:
a_release = [autoxml.String, autoxml.mandatory]
@@ -102,7 +105,13 @@ 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]
t_Requires = [[Action], autoxml.optional]
def required_actions(self):
if self.requires != None:
return map(lambda x:str(x), self.requires)
else:
return []
def __str__(self):
s = self.date