Rationale ========= Version information in a string is ugly and impossible to parse. It results in hacks like the existence of multiple USE flags such as gtk1/gtk2, qt3/qt4, sqlite/sqlite3, db1/db2/db3/db4, etc. Solution ======== This is the same problem we already solved in package versioning by using SLOTs, shown here as CP:SLOT (category-package:slot). It makes sense to solve this problem the same way, by adding SLOTs to USE flags. Specification ============= With a dependency such as qt? ( =x11-libs/qt-3* ) the SLOT of the inner dependency will be parsed out and associated with the name of the USE flag. This will result in a USE setting like USE="qt:3". Use of SLOT glob matches to available USE:SLOTs will be allowed. The default USE:SLOT will be ":*" to retain full backwards compatibility. This becomes more complex in the case of multiple USE-based dependencies pulled in by a single flag. For this case, we will again default to no USE:SLOT setting for backwards compatibility, but we will allow mapping a CP:USE pair in IUSE. For completeness' sake, we'll allow the USE:CP pairing to use a full ${PF} match. For the dependency group qt? ( =x11-libs/qt-3* media-libs/mesa ) the USE:CP pair in IUSE would be IUSE="qt:x11-libs/qt" When used in combination with the existing SLOT-based dependencies, this could result in something like IUSE="qt:x11-libs/qt" qt? ( x11-libs/qt:3 media-libs/mesa ) In this case, USE="qt:3", USE="qt:*" or the implied :* of USE="qt" would all work. In the case of multiple matching USE:SLOT pairs, standard version resolution will determine which SLOT of a slotted dependency is pulled in. Implementation ideas ==================== One way to implement this is as a pre-filter. Hook it in so it feeds the package manager what the PM thinks is the original, complete ebuild list for "standard" visibility resolution. This filter, combined with some code to deal with parsing out everything following colons in USE and IUSE, should take care of most of it.