5.3. Group Variables and Actions

Group recipes use a special part of the Conary API targeted to pulling together components, packages, and other groups so they can be installed and managed together. Groups allow you to identify specific versions of components that you know will work together, and to enforce version control on that group as a whole.

Groups recipes start something like this:

class GroupExample(GroupRecipe):
    name = 'group-example'
    version = '0.1'

    def setup(r):
        # Add items to the group here

From there, set additional variables and add recipe actions. You can set the following additional variables in a recipe inheriting from GroupRecipe:

After your variables are set as you need, add actions to the setup() method in the group. Choose from those listed in the following table:

Table 5.8. Group Actions

Action (Method Call)Description and API Link
r.add Add a component, package, or other group to your group
API Doc: http://cvs.rpath.com/conary-docs/public/conary.build.grouprecipe._GroupRecipe-class.html#add
r.addAll Add all components, packages, or other groups that are directly contained within a specified group into your group (or a subgroup identified with groupName= if you're using r.createGroup())
API Doc: http://cvs.rpath.com/conary-docs/public/conary.build.grouprecipe._GroupRecipe-class.html#addAll
r.addCopy Create a copy of the named component, package, or other group, and add that copy to your group (or a subgroup identified with groupName= if you're using r.createGroup())
API Doc: http://cvs.rpath.com/conary-docs/public/conary.build.grouprecipe._GroupRecipe-class.html#addCopy
r.addNewGroup Add one newly created group to another newly created group to created a nesting structure with groups when you're using r.createGroup()
API Doc: http://cvs.rpath.com/conary-docs/public/conary.build.grouprecipe._GroupRecipe-class.html#addNewGroup
r.addResolveSource Specify an alternate source for resolving group dependencies
API Doc: http://cvs.rpath.com/conary-docs/public/conary.build.grouprecipe._GroupRecipe-class.html#addResolveSource
r.copyComponents Add components to your group by copying them from another group
API Doc: http://cvs.rpath.com/conary-docs/public/conary.build.grouprecipe._GroupRecipe-class.html#copyComponents
r.createGroup Create a new group (subgroup to your group)
API Doc: http://cvs.rpath.com/conary-docs/public/conary.build.grouprecipe._GroupRecipe-class.html#createGroup
r.moveComponents Add components to one group while removing them from another
API Doc: http://cvs.rpath.com/conary-docs/public/conary.build.grouprecipe._GroupRecipe-class.html#moveComponents
r.remove Remove a component, package or other group from your group; typical when you're adding another group, but you need to remove certain items that are managed by that group
API Doc: http://cvs.rpath.com/conary-docs/public/conary.build.grouprecipe._GroupRecipe-class.html#remove
r.removeComponents Indicate a component in your group that should not be installed by default when the group is installed
API Doc: http://cvs.rpath.com/conary-docs/public/conary.build.grouprecipe._GroupRecipe-class.html#removeComponents
r.removeItemsAlsoInGroup Remove components or packages from a specified group (which you added to your your group) that are also added as components or packages in your own group
API Doc: http://cvs.rpath.com/conary-docs/public/conary.build.grouprecipe._GroupRecipe-class.html#removeItemsAlsoInGroup
r.removeItemsAlsoInNewGroup Remove components or packages from a specified group (which you added to your your group) that are also added as components or packages in your own group
API Doc: http://cvs.rpath.com/conary-docs/public/conary.build.grouprecipe._GroupRecipe-class.html#removeItemsAlsoInNewGroup
r.Requires Create a runtime requirement for the group, indicating that a specific component, package, or other group must be installed in order for your group to be installed
API Doc: http://cvs.rpath.com/conary-docs/public/conary.build.grouprecipe._GroupRecipe-class.html#Requires
r.replace Replace a specific component, package, or other group with another one; typically used when you add a software group (such as a platform) to your group, but you have your own version of a package that should replace the one brought in by that software group (or platform)
API Doc: http://cvs.rpath.com/conary-docs/public/conary.build.grouprecipe._GroupRecipe-class.html#replace
r.setByDefault Set components, packages, and other groups that should be added to your group by default
API Doc: http://cvs.rpath.com/conary-docs/public/conary.build.grouprecipe._GroupRecipe-class.html#setByDefault
r.setDefaultGroup If you're using r.createGroup(), set the default group to which all components are added if a groupName argument is not provided to its corresponding add or replace action
API Doc: http://cvs.rpath.com/conary-docs/public/conary.build.grouprecipe._GroupRecipe-class.html#setDefaultGroup
r.setLabelPath Specify on which labels to search for components, packages, and other groups to be included in your group
API Doc: http://cvs.rpath.com/conary-docs/public/conary.build.grouprecipe._GroupRecipe-class.html#setDefaultGroup
r.setSearchPath Specify the search path on which to search for components, packages, and other groups to be included in your group; unlike r.setLabelPath(), this action can include both label and troveSpec arguments (a troveSpec is in the form <name>[=version][[flavor]] and is usually used to target a software group such as group-dist associated with a certain platform)
API Doc: http://cvs.rpath.com/conary-docs/public/conary.build.grouprecipe._GroupRecipe-class.html#setSearchPath