* 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:
@@ -71,7 +71,7 @@ def find_upgrades(packages, replaces):
|
|||||||
if not pisi.util.any(lambda i:i.type == 'security', updates):
|
if not pisi.util.any(lambda i:i.type == 'security', updates):
|
||||||
continue
|
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)))
|
Ap.extend(map(lambda d:d[0], packagedb.get_rev_deps(u_pkg)))
|
||||||
|
|
||||||
if ignore_build or (not build) or (not pkg.build):
|
if ignore_build or (not build) or (not pkg.build):
|
||||||
|
|||||||
+20
-11
@@ -64,6 +64,19 @@ class AdditionalFile:
|
|||||||
s += '(%s)' % self.permission
|
s += '(%s)' % self.permission
|
||||||
return s
|
return s
|
||||||
|
|
||||||
|
class Action:
|
||||||
|
|
||||||
|
# Valid actions:
|
||||||
|
#
|
||||||
|
# reverseDependencyUpdate
|
||||||
|
# systemRestart
|
||||||
|
# serviceRestart
|
||||||
|
|
||||||
|
s_action = [autoxml.String, autoxml.mandatory]
|
||||||
|
|
||||||
|
def __str__(self):
|
||||||
|
return self.action
|
||||||
|
|
||||||
class Patch:
|
class Patch:
|
||||||
|
|
||||||
s_Filename = [autoxml.String, autoxml.mandatory]
|
s_Filename = [autoxml.String, autoxml.mandatory]
|
||||||
@@ -83,16 +96,6 @@ class Patch:
|
|||||||
s += ' level:' + self.level
|
s += ' level:' + self.level
|
||||||
return s
|
return s
|
||||||
|
|
||||||
class Requires:
|
|
||||||
|
|
||||||
# Valid actions:
|
|
||||||
#
|
|
||||||
# reverseDependencyUpdate
|
|
||||||
# systemRestart
|
|
||||||
# serviceRestart
|
|
||||||
|
|
||||||
t_Action = [ [autoxml.String], autoxml.mandatory]
|
|
||||||
|
|
||||||
class Update:
|
class Update:
|
||||||
|
|
||||||
a_release = [autoxml.String, autoxml.mandatory]
|
a_release = [autoxml.String, autoxml.mandatory]
|
||||||
@@ -102,7 +105,13 @@ class Update:
|
|||||||
t_Comment = [autoxml.String, autoxml.optional]
|
t_Comment = [autoxml.String, autoxml.optional]
|
||||||
t_Name = [autoxml.Text, autoxml.optional]
|
t_Name = [autoxml.Text, autoxml.optional]
|
||||||
t_Email = [autoxml.String, 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):
|
def __str__(self):
|
||||||
s = self.date
|
s = self.date
|
||||||
|
|||||||
Reference in New Issue
Block a user