diff --git a/pisi/operations.py b/pisi/operations.py index ca1629da..f0f24c04 100644 --- a/pisi/operations.py +++ b/pisi/operations.py @@ -392,8 +392,10 @@ def upgrade_pkg_names(A = []): ctx.ui.info(_('Package %s is not available in repositories.') % x, True) continue - if security and pkg.history[0].type != 'security': - continue + if security: # below is a readable functional code, don't overflow lines! + updates = [x for x in pkg.history if Version(x.release) > Version(release)] + if not pisi.util.any(lambda x:x.type == 'security', updates): + continue if ignore_build or (not build) or (not pkg.build): if Version(release) < Version(pkg.release): diff --git a/pisi/util.py b/pisi/util.py index e3dd19d9..faa8cfc7 100644 --- a/pisi/util.py +++ b/pisi/util.py @@ -74,10 +74,10 @@ class Checks: ######################### def every(pred, seq): - return reduce(operator.and_, map(pred, seq)) + return reduce(operator.and_, map(pred, seq), True) def any(pred, seq): - return reduce(operator.or_, map(pred, seq)) + return reduce(operator.or_, map(pred, seq), False) def unzip(seq): return zip(*seq)