diff options
author | Jon Turney <jon.turney@dronecode.org.uk> | 2022-07-10 17:54:47 +0300 |
---|---|---|
committer | Jon Turney <jon.turney@dronecode.org.uk> | 2023-01-06 16:00:37 +0300 |
commit | aec1dcf7af8df98df4c7ded84fd3a7a7750f9efd (patch) | |
tree | 8ec2bdffd47c623d2239c7581f2aa464cb35578e | |
parent | a7c7e071b30ea9172e3bff9d8cd33fa62900f0ff (diff) |
Allow package version to be marked as weakly retained
Allow a package version to be explicitly marked as weakly retained in
override.hint.
Ideally, we'd like something that let's us make a transaction that
removes a given source package and all install packages generated from
it, but we're not there yet...
-rwxr-xr-x | calm/hint.py | 1 | ||||
-rwxr-xr-x | calm/package.py | 10 |
2 files changed, 11 insertions, 0 deletions
diff --git a/calm/hint.py b/calm/hint.py index ddfcf74..6034c1d 100755 --- a/calm/hint.py +++ b/calm/hint.py @@ -93,6 +93,7 @@ hintkeys[override] = { 'keep-superseded-test': 'noval', 'disable-check': 'val', 'replace-versions': 'val', + 'noretain': 'val', } # valid categories diff --git a/calm/package.py b/calm/package.py index d3b5ab0..4538b8d 100755 --- a/calm/package.py +++ b/calm/package.py @@ -1529,6 +1529,16 @@ def stale_packages(packages): mark = dep_so_age_mark + elif 'noretain' in po.override_hints: + def noretain_hint_mark(v): + noretain_versions = po.override_hints.get('noretain', '').split() + if (v in noretain_versions) or ('all' in noretain_versions): + return Freshness.conditional + else: + return Freshness.fresh + + mark = noretain_hint_mark + # mark any versions explicitly listed in the keep: override hint (unconditionally) for v in po.override_hints.get('keep', '').split(): if v in po.versions(): |