forked from Mirror/pmbootstrap
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:
parent
4f030db299
commit
e4df6c5d22
1 changed files with 9 additions and 6 deletions
|
@ -116,7 +116,7 @@ def parse_next_block(args, path, lines, start):
|
||||||
|
|
||||||
|
|
||||||
def parse_add_block(path, strict, ret, block, pkgname=None,
|
def parse_add_block(path, strict, ret, block, pkgname=None,
|
||||||
version=None):
|
version_new=None):
|
||||||
"""
|
"""
|
||||||
Add one block to the return dictionary of parse().
|
Add one block to the return dictionary of parse().
|
||||||
|
|
||||||
|
@ -137,15 +137,18 @@ def parse_add_block(path, strict, ret, block, pkgname=None,
|
||||||
# Defaults
|
# Defaults
|
||||||
if not pkgname:
|
if not pkgname:
|
||||||
pkgname = block["pkgname"]
|
pkgname = block["pkgname"]
|
||||||
if not version:
|
if not version_new:
|
||||||
version = block["version"]
|
version_new = block["version"]
|
||||||
|
|
||||||
# Handle duplicate entries
|
# Handle duplicate entries
|
||||||
if pkgname in ret:
|
if pkgname in ret:
|
||||||
if strict:
|
if strict:
|
||||||
raise RuntimeError("Multiple blocks for " +
|
raise RuntimeError("Multiple blocks for " + pkgname +
|
||||||
pkgname + " in " + path)
|
" in " + path)
|
||||||
if compare_version(ret[pkgname]["version"], version) < 1:
|
# 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
|
return
|
||||||
|
|
||||||
# Add it to the result set
|
# Add it to the result set
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue