diff options
author | Jon Turney <jon.turney@dronecode.org.uk> | 2022-06-30 21:07:20 +0300 |
---|---|---|
committer | Jon Turney <jon.turney@dronecode.org.uk> | 2022-07-01 14:52:58 +0300 |
commit | 78dc0051e7f53830f72c219c437a5b175906dfd2 (patch) | |
tree | 6f249b54e9ba4e6587d8f2f1ad721522ecc8c5aa | |
parent | eca3a88d174516051883b5c7404f6985939d4b4e (diff) |
Improve deprecated soversion expiry (again)
"unused" should mean "no packages from a different source package depend
on it", not "no packages depend on it".
e.g. 'bind' produces both 'libdns165', and 'libbind9_140' which depends
on it. Both are eligible for expiry when they have no other rdepends
outside of 'bind'.
-rwxr-xr-x | calm/package.py | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/calm/package.py b/calm/package.py index 6370351..32b4d31 100755 --- a/calm/package.py +++ b/calm/package.py @@ -1451,15 +1451,17 @@ def stale_packages(packages): # shouldn't retain anything. # # - shared library packages which don't come from the current version of - # source (i.e. is superseded or removed), have no packages which depend - # on them, and are over a certain age + # source (i.e. is superseded or removed), have no packages from a + # different source package which depend on them, and are over a certain + # age # mark = Freshness.fresh if pn.endswith('-debuginfo'): mark = Freshness.conditional - if (len(po.rdepends) == 0) and re.match(common_constants.SOVERSION_PACKAGE_RE, pn): - bv = po.best_version - es = po.version_hints[bv].get('external-source', None) + bv = po.best_version + es = po.version_hints[bv].get('external-source', None) + if (re.match(common_constants.SOVERSION_PACKAGE_RE, pn) and + not any(packages[p].srcpackage(packages[p].best_version) != es for p in po.rdepends)): if es and (packages[es].best_version != bv): def dep_so_age_mark(v): mtime = po.tar(v).mtime |