Package set operators

Ok, just a quick notice that portage 2.2_rc10 (or 2.2 final if there isn’t another RC) will not only support package sets as defined in sets.conf, but also expressions to generate unions, intersections and differences of multiple package sets. This for example allow you to temporarily exclude @system from @world (assuming you have @system in your world_sets file) by running emerge @world-@system.
Other operators are / for intersections (select only atoms included in both sets) and + for unions. The latter is useful as expressions can contain more than one operator, e.g. emerge @kde+@gnome/@installed to reinstall all kde and gnome packages that are already installed (assuming kde and gnome sets are defined somewhere).

This feature is just a few minutes old, so it will probably be extended or otherwise changed in the future. Current restrictions include

  • strict left-to-right evaluation order
  • only defined package sets can be used as operands (no package names)
  • feature is currently only available on the commandline, not via sets.conf

And while I’m on it, I’ve also added a new AgeSet class to select installed packages that are older/newer than a given number of days.