Software applications change over time, and your packaging needs will change with them. Use this section when the maintenance path for your package or group has changed. In other words, you have a package or group that is no longer maintained where it is, and it needs to redirect to a different package or group for ongoing maintenance. Your package or group could redirect to:
The same package or group, but on a different label
A different package or group
Multiple other packages or groups (common when breaking a larger package into smaller pieces for modularity)
Use the following steps to redirect your package or group:
Check out the package or group source and open its recipe in your preferred text editor.
Remove any loaded recipes or superclasses above the class declaration.
Change the inheritance for the class so it only inherits RedirectRecipe:
class Example(RedirectRecipe):
Remove all variable assignments except name and version, and change the version value to 0 (zero):
name = 'example' version = '0'
If you're redirecting to multiple targets, add one new variable allowMulipleTargets set equal to True:
name = 'example' version = '0' allowMultipleTargets = True
Remove all methods, and just define a single setup method:
def setup(r):
Add redirects to your setup method as follows:
If you're redirecting to only one other package or group, add a single addRedirect action with two arguments: the target package name, and the label on which it resides. The following is in a redirect recipe redirecting to perl-Mail-SpamAssassin on the rPath Linux development label:
def setup(r):
r.addRedirect('perl-Mail-SpamAssassin', 'conary.rpath.com@rpl:devel')
If you're redirecting to multiple targets, use multiple addRedirect actions. If the targets are on the same label, consider code like in the following example, which creates a list of targets in a Python array, and then uses a for loop to iterate over that array when adding the redirect action:
def setup(r):
target_list = [ 'example-server', 'example-client', 'example-common']
for x in target_list:
r.addRedirect( x, 'example.rpath.org@corp:example-4')
Build your package or group as with any other package or group, and test to be sure it redirects to the appropriate targets when installed.
You can always undo your redirect by changing the recipe back to a normal package or group recipe.