From 4cd3da7f48b74abfc48d36cf2c700c4eebfcbb40 Mon Sep 17 00:00:00 2001 From: Sergei Trofimovich Date: Sun, 17 Jun 2012 11:42:51 +0300 Subject: repoman: add 'VIRTUAL.suspect' class of warnings Searches all the *DEPENDS against static map of: { 'package' : 'virtual' } Example output: > VIRTUAL.suspect 1 > dev-haskell/cabal/cabal-1.15.0_pre20120608.ebuild: consider using 'virtual/pkgconfig' insted of 'dev-util/pkgconf' Signed-off-by: Sergei Trofimovich --- bin/repoman | 18 ++++++++++++++++++ man/repoman.1 | 4 ++++ 2 files changed, 22 insertions(+) diff --git a/bin/repoman b/bin/repoman index 7204f50dc..795c7ce77 100755 --- a/bin/repoman +++ b/bin/repoman @@ -393,6 +393,7 @@ qahelp={ "metadata.warning":"Warnings in metadata.xml files", "portage.internal":"The ebuild uses an internal Portage function", "virtual.oldstyle":"The ebuild PROVIDEs an old-style virtual (see GLEP 37)", + "virtual.suspect":"Ebuild contains a package that usually should be pulled via virtual/, not directly.", "usage.obsolete":"The ebuild makes use of an obsolete construct", "upstream.workaround":"The ebuild works around an upstream bug, an upstream bug should be filed and tracked in bugs.gentoo.org" } @@ -424,6 +425,7 @@ qawarnings = set(( "PDEPEND.suspect", "RDEPEND.implicit", "RDEPEND.suspect", +"virtual.suspect", "RESTRICT.invalid", "ebuild.minorsyn", "ebuild.badheader", @@ -513,6 +515,13 @@ suspect_rdepend = frozenset([ "x11-misc/imake", ]) +suspect_virtual = { + "dev-util/pkg-config-lite":"virtual/pkgconfig", + "dev-util/pkgconf":"virtual/pkgconfig", + "dev-util/pkgconfig":"virtual/pkgconfig", + "dev-util/pkgconfig-openbsd":"virtual/pkgconfig", +} + metadata_dtd_uri = 'http://www.gentoo.org/dtd/metadata.dtd' # force refetch if the local copy creation time is older than this metadata_dtd_ctime_interval = 60 * 60 * 24 * 7 # 7 days @@ -1884,6 +1893,15 @@ for x in effective_scanlist: is_blocker = atom.blocker + if catdir != "virtual": + if not is_blocker and \ + atom.cp in suspect_virtual: + stats['virtual.suspect'] += 1 + fails['virtual.suspect'].append( + relative_path + + ": %s: consider using '%s' instead of '%s'" % + (mytype, suspect_virtual[atom.cp], atom)) + if mytype == "DEPEND" and \ not is_blocker and \ not inherited_java_eclass and \ diff --git a/man/repoman.1 b/man/repoman.1 index 26575a9ca..b8c0f48e3 100644 --- a/man/repoman.1 +++ b/man/repoman.1 @@ -382,6 +382,10 @@ Ebuild uses D, ROOT, ED, EROOT or EPREFIX with helpers The ebuild PROVIDEs an old-style virtual (see GLEP 37). This is an error unless "allow\-provide\-virtuals = true" is set in metadata/layout.conf. .TP +.B virtual.suspect +Ebuild contains a package that usually should be pulled via virtual/, +not directly. +.TP .B wxwidgets.eclassnotused Ebuild DEPENDs on x11-libs/wxGTK without inheriting wxwidgets.eclass. Refer to bug #305469 for more information. -- cgit v1.2.3-1-g7c22