More extensions to package set support

After writing my previous post about set operators I’ve added a few more things related to package sets to portage. First, operators can now also be used inside sets.conf files using the extend, remove and intersect options, each taking a whitespace separated list of set names (without the @ prefix), working analog to the operators in set expressions described in the previous post. The main difference is that the evaluation order is fixed now (unions come first, differences second and intersections last) while in expressions it’s left-to-right.

The second new feature is that package sets can now be (re)defined on the emerge command line. This is done using the following syntax:
emerge '@setname{key1=value1,key2=value2}'
where setname can either be an existing package set, or a new one to define a set without having to modify any files. Note the quotes that are necessary to ensure that emerge gets the argument as-is without interference from the shell. The nice thing is this syntax also works inside set expressions. The not-so-nice thing is that for now there are a few restrictions about the values you can use, as there is no quoting mechanism implemented yet (this is planned however). So using any of the following characters or whitespace inside the braces will lead to undefined behavior: { } @ = ,
Another restriction is that you may not redefine package sets that are created by a multiset section in sets.conf (as those use different options that only make sense when defining multiple sets at once).
Note that for redefining existing package sets you only have to pass those options that should be different from the sets.conf definition.

And last but not least, to make the above features a bit easier to use there is also a new DummyPackageSet class that can be used to build a package set only by using operators, and/or to include a few packages without having to edit an external file. So it’s even easier than before to define a new set @world-without-system, using
[world-without-system]
class=portage.sets.base.DummyPackageSet
extend=world
remove=system

This entry was posted in Portage. Bookmark the permalink.

3 Responses to More extensions to package set support

  1. Jake says:

    Hi there, I’d just like to take this time to tell you personally how much I loved reading your blog. I believe that everyone would benefit from reading this as it has a slew of wonderful information and knowledge that could be gained in reading your post. So, I’d just like to tell you thanks for taking the time out of your busy schedule to write this valuable post as I’m certain that I am not the only one that gained a great deal of information out of reading this. I will be checking back on this blog periodically to check and see if you’ve written more great posts, as I’m sure a lot of other people will be too. Take care, can’t wait to see what else you post!

  2. Hi there,

    Hey baby cool blog post, I am loving the entire concept of it

    Thanks,
    Jenelia