Kaydet (Commit) 3481d9cf authored tarafından Eray Özkural's avatar Eray Özkural

* fix: consider not only the last update but all those friggin' updates

* fix: handle empty sequences in any and every fnxs
üst 0956de2f
...@@ -392,8 +392,10 @@ def upgrade_pkg_names(A = []): ...@@ -392,8 +392,10 @@ def upgrade_pkg_names(A = []):
ctx.ui.info(_('Package %s is not available in repositories.') % x, True) ctx.ui.info(_('Package %s is not available in repositories.') % x, True)
continue continue
if security and pkg.history[0].type != 'security': if security: # below is a readable functional code, don't overflow lines!
continue 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 ignore_build or (not build) or (not pkg.build):
if Version(release) < Version(pkg.release): if Version(release) < Version(pkg.release):
......
...@@ -74,10 +74,10 @@ class Checks: ...@@ -74,10 +74,10 @@ class Checks:
######################### #########################
def every(pred, seq): def every(pred, seq):
return reduce(operator.and_, map(pred, seq)) return reduce(operator.and_, map(pred, seq), True)
def any(pred, seq): def any(pred, seq):
return reduce(operator.or_, map(pred, seq)) return reduce(operator.or_, map(pred, seq), False)
def unzip(seq): def unzip(seq):
return zip(*seq) return zip(*seq)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment