Skip to content

Commit 4bda26a

Browse files
committed
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>
1 parent 26f4edf commit 4bda26a

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

src/pkgcheck/checks/profiles.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,11 @@
1919

2020
class OutdatedProfilePackage(results.ProfilesResult, results.Warning):
2121
"""Profile files includes package entry that doesn't exist in the repo
22-
for a mentioned period of time."""
22+
for a mentioned period of time.
23+
24+
This is only reported if the version was removed more than 3 months ago,
25+
or all versions of this package were removed (i.e. last-rite).
26+
"""
2327

2428
def __init__(self, path, atom, age):
2529
super().__init__()
@@ -261,9 +265,10 @@ def _report_unknown_atom(self, path, atom):
261265
removal = max(x.time for x in matches)
262266
removal = datetime.fromtimestamp(removal)
263267
years = (self.today - removal).days / 365.2425
264-
return OutdatedProfilePackage(path, atom, round(years, 2))
265-
else:
266-
return UnknownProfilePackage(path, atom)
268+
# show years value if it's greater than 3 month, or if the package was removed
269+
if years > 0.25 or not self.search_repo.match(atom.unversioned_atom):
270+
return OutdatedProfilePackage(path, atom, round(years, 2))
271+
return UnknownProfilePackage(path, atom)
267272

268273
@verify_files(("parent", "parents"), ("eapi", "eapi"))
269274
def _pull_attr(self, *args):

0 commit comments

Comments
 (0)