* fix: consider not only the last update but all those friggin' updates
* fix: handle empty sequences in any and every fnxs
This commit is contained in:
+4
-2
@@ -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):
|
||||
|
||||
+2
-2
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user