aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArthur Zamarin <arthurzam@gentoo.org>2023-12-08 19:45:14 +0200
committerArthur Zamarin <arthurzam@gentoo.org>2023-12-10 20:51:01 +0200
commit4bda26afd8ee21385dcaadb4fdf7b70db0a1c594 (patch)
tree1b1dcdde01a2b28e82a3ff1af4249402a4e4c676
parentMissingRemoteId: expand gitlab matching rules (diff)
downloadpkgcheck-4bda26afd8ee21385dcaadb4fdf7b70db0a1c594.tar.gz
pkgcheck-4bda26afd8ee21385dcaadb4fdf7b70db0a1c594.tar.bz2
pkgcheck-4bda26afd8ee21385dcaadb4fdf7b70db0a1c594.zip
OutdatedProfilePackage: don't warn when version was removed not long ago
Requested-by: Sam James <sam@gentoo.org> Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
-rw-r--r--src/pkgcheck/checks/profiles.py13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/pkgcheck/checks/profiles.py b/src/pkgcheck/checks/profiles.py
index 8a8248c7..6b3db0c5 100644
--- a/src/pkgcheck/checks/profiles.py
+++ b/src/pkgcheck/checks/profiles.py
@@ -19,7 +19,11 @@ from . import Check, RepoCheck
class OutdatedProfilePackage(results.ProfilesResult, results.Warning):
"""Profile files includes package entry that doesn't exist in the repo
- for a mentioned period of time."""
+ for a mentioned period of time.
+
+ This is only reported if the version was removed more than 3 months ago,
+ or all versions of this package were removed (i.e. last-rite).
+ """
def __init__(self, path, atom, age):
super().__init__()
@@ -261,9 +265,10 @@ class ProfilesCheck(Check):
removal = max(x.time for x in matches)
removal = datetime.fromtimestamp(removal)
years = (self.today - removal).days / 365.2425
- return OutdatedProfilePackage(path, atom, round(years, 2))
- else:
- return UnknownProfilePackage(path, atom)
+ # show years value if it's greater than 3 month, or if the package was removed
+ if years > 0.25 or not self.search_repo.match(atom.unversioned_atom):
+ return OutdatedProfilePackage(path, atom, round(years, 2))
+ return UnknownProfilePackage(path, atom)
@verify_files(("parent", "parents"), ("eapi", "eapi"))
def _pull_attr(self, *args):