Fix #96: Check if build is necessary is broken.

When an APKINDEX contained a package with multiple versions,
pmbootstrap did not use the last version to determine if the
package is out of date (regression from af8c9fcf5b).
This commit is contained in:
Oliver Smith 2017-06-18 22:15:36 +02:00
parent 4f030db299
commit e4df6c5d22
No known key found for this signature in database
GPG Key ID: 5AE7F5513E0885CB
1 changed files with 9 additions and 6 deletions

View File

@ -116,7 +116,7 @@ def parse_next_block(args, path, lines, start):
def parse_add_block(path, strict, ret, block, pkgname=None,
version=None):
version_new=None):
"""
Add one block to the return dictionary of parse().
@ -137,15 +137,18 @@ def parse_add_block(path, strict, ret, block, pkgname=None,
# Defaults
if not pkgname:
pkgname = block["pkgname"]
if not version:
version = block["version"]
if not version_new:
version_new = block["version"]
# Handle duplicate entries
if pkgname in ret:
if strict:
raise RuntimeError("Multiple blocks for " +
pkgname + " in " + path)
if compare_version(ret[pkgname]["version"], version) < 1:
raise RuntimeError("Multiple blocks for " + pkgname +
" in " + path)
# Ignore the block, if the block we already have has a higher
# version
version_old = ret[pkgname]["version"]
if compare_version(version_old, version_new) == 1:
return
# Add it to the result set