diff options
author | Jon Turney <jon.turney@dronecode.org.uk> | 2018-03-05 01:57:50 +0300 |
---|---|---|
committer | Jon Turney <jon.turney@dronecode.org.uk> | 2018-03-05 01:58:21 +0300 |
commit | 37099fb8b4007e7d10a6eded2bb2e849500f9b3f (patch) | |
tree | a75523f27c8500da952896ab967df0898af9a026 | |
parent | 0c45049b6635216921348e00d7e88d782fe6868c (diff) |
Warn if replace-versions: lists a version which is also offered for install
-rwxr-xr-x | calm/package.py | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/calm/package.py b/calm/package.py index e54ed25..85d5368 100755 --- a/calm/package.py +++ b/calm/package.py @@ -647,15 +647,20 @@ def validate_packages(args, packages): packages[p].best_version = None error = True - # warn if replace-versions lists a version which is less than the - # current version (which is pointless as the current version will - # replace it anyhow) if 'replace-versions' in packages[p].override_hints: - if packages[p].best_version: - for rv in packages[p].override_hints['replace-versions'].split(): + for rv in packages[p].override_hints['replace-versions'].split(): + # warn if replace-versions lists a version which is less than + # the current version (which is pointless as the current version + # will replace it anyhow) + if packages[p].best_version: if SetupVersion(rv) <= SetupVersion(packages[p].best_version): logging.warning("package '%s' replace-versions: uselessly lists version '%s', which is <= current version" % (p, rv)) + # warn if replace-versions lists a version which is also + # available to install (as this doesn't work as expected) + if rv in packages[p].version_hints: + logging.warning("package '%s' replace-versions: lists version '%s', which is also available to install" % (p, rv)) + # If the install tarball is empty and there is no source tarball, we # should probably be marked obsolete if not packages[p].skip: |