Skip to content

Commit

Permalink
repoman: support profiles/package.deprecated (bug 702100)
Browse files Browse the repository at this point in the history
Bug: https://bugs.gentoo.org/702100
Signed-off-by: Zac Medico <zmedico@gentoo.org>
  • Loading branch information
zmedico committed Dec 6, 2019
1 parent 545fbfc commit 1b1e0fc
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 0 deletions.
1 change: 1 addition & 0 deletions repoman/cnf/qa_data/qa_data.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ qahelp:
badinexp: "User-visible ebuilds with unsatisfied dependencies (matched against *visible* ebuilds) in experimental arch"
badmaskedinexp: "Masked ebuilds with unsatisfied dependencies (matched against *all* ebuilds) in experimental arch"
badtilde: "Uses the ~ dep operator with a non-zero revision part, which is useless (the revision is ignored)"
deprecated: "Ebuild has a dependency that refers to a deprecated package"
equalsversion: "Suspicious =-dependency with a specific version and no rev. Please either use ~ if any revision is acceptable, or append -r0 to silence the warning."
missingslot: "RDEPEND matches more than one SLOT but does not specify a slot and/or use the := or :* slot operator"
perlcore: "This ebuild directly depends on a package in perl-core; it should use the corresponding virtual instead."
Expand Down
1 change: 1 addition & 0 deletions repoman/cnf/repository/qa_data.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ qawarnings:
- dependency.badindev
- dependency.badmaskedindev
- dependency.badtilde
- dependency.deprecated
- dependency.equalsversion
- dependency.missingslot
- dependency.perlcore
Expand Down
14 changes: 14 additions & 0 deletions repoman/lib/repoman/modules/scan/depend/_depend_checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,20 @@ def _depend_checks(ebuild, pkg, portdb, qatracker, repo_metadata, qadata):
not atom.cp.startswith("virtual/"):
unknown_pkgs.add((mytype, atom.unevaluated_atom))

if not atom.blocker:
all_deprecated = False
for pkg_match in portdb.xmatch("match-all", atom):
if any(repo_metadata['package.deprecated'].iterAtomsForPackage(pkg_match)):
all_deprecated = True
else:
all_deprecated = False
break

if all_deprecated:
qatracker.add_error(
'dependency.deprecated',
ebuild.relative_path + ": '%s'" % atom)

if pkg.category != "virtual":
if not is_blocker and \
atom.cp in qadata.suspect_virtual:
Expand Down
4 changes: 4 additions & 0 deletions repoman/lib/repoman/scanner.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import portage
from portage import normalize_path
from portage import os
from portage._sets.base import InternalPackageSet
from portage.output import green
from portage.util.futures.extendedfutures import ExtendedFuture
from repoman.metadata import get_metadata_xsd
Expand Down Expand Up @@ -93,6 +94,9 @@ def __init__(self, repo_settings, myreporoot, config_root, options,
'profile_list': profile_list,
'pmaskdict': global_pmaskdict,
'lic_deprecated': liclist_deprecated,
'package.deprecated': InternalPackageSet(initial_atoms=portage.util.stack_lists(
[portage.util.grabfile_package(os.path.join(path, 'profiles', 'package.deprecated'), recursive=True)
for path in self.portdb.porttrees], incremental=True))
}

self.repo_settings.repoman_settings['PORTAGE_ARCHLIST'] = ' '.join(sorted(kwlist))
Expand Down
3 changes: 3 additions & 0 deletions repoman/man/repoman.1
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,9 @@ experimental arch
Uses the ~ dep operator with a non-zero revision part, which is useless (the
revision is ignored)
.TP
.B dependency.deprecated
Ebuild has a dependency that refers to a deprecated package
.TP
.B dependency.syntax
Syntax error in dependency string (usually an extra/missing space/parenthesis)
.TP
Expand Down

0 comments on commit 1b1e0fc

Please sign in to comment.