diff options
author | Jon Turney <jon.turney@dronecode.org.uk> | 2020-05-25 18:28:59 +0300 |
---|---|---|
committer | Jon Turney <jon.turney@dronecode.org.uk> | 2020-05-25 20:34:43 +0300 |
commit | c9b5ce5b9352bd575200a9a675fca61c1b6bf429 (patch) | |
tree | 5b21ee0bcc2202e68fc4bb5a2c031f1d7d41739c | |
parent | fb3a4d3cb501a22b3d55165fc3d6fd222ae47c51 (diff) |
Consider versions overriden by version: when checking if a hint is stale
When uploading a replacement hint with a version: override, the overriden
version doesn't exist anymore, so the hint will be considered stale and
removed.
This causes the upload to fail as movelist validation notices that the
hint is both uploaded and automatically vaulted.
-rwxr-xr-x | calm/package.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/calm/package.py b/calm/package.py index 487c3ed..66d03df 100755 --- a/calm/package.py +++ b/calm/package.py @@ -394,6 +394,8 @@ def read_one_package(packages, p, relpath, dirpath, files, remove, kind): # apply a version override if 'version' in pvr_hint: ovr = pvr_hint['version'] + # also record the version before the override + pvr_hint['original-version'] = vr else: ovr = vr @@ -1411,8 +1413,9 @@ def stale_packages(packages): for v in po.hints: # if there's a pvr.hint without a fresh source or install of the - # same version, move it as well - if all_stale.get(v, True): + # same version (including version: overrides), move it as well + ov = po.hints[v].hints.get('original-version', v) + if all_stale.get(v, True) and all_stale.get(ov, True): stale.add(po.hints[v].path, po.hints[v].fn) logging.debug("package '%s' version '%s' hint is stale" % (pn, v)) |