Conary:Redirect Packages
From rPath Wiki
Conary packagers can write a package recipe to redirect. If the upstream name changes, change the name of the package as well. This means creating a new package with the new name, and then changing the old package into a redirect that points to the new package. Users who update the package using the old name will automatically be updated to the new package.
Alternatively, if you change the package that provides the same functionality, you can do the exact same thing; from Conary's point of view there is no difference. For example, rPath Linux used to use the old mailx program to provide /usr/bin/mail, but switched to the newer nail program for that task. The mailx recipe was then changed to create a redirect to the newer nail package. Anyone updating the mailx package automatically got the nail package instead.
A redirect is not necessarily forever. Later, the nail program upstream was renamed to mailx, taking over the name. The old recipe for mailx was restored and modified, and a new version cooked. The nail recipe was then changed to a redirect back to mailx. Now, if you update from the older version of mailx, Conary would completely ignore the temporary appearance of the redirect to nail.
Redirects pointing from the old troves to the new troves solve the obsoletes wars that show up with RPM packages. In the RPM universe, two packages can each say that they obsolete each other. In the Conary world, redirects are checked at cook time to ensure that there are no dead ends or loops.
See Conary:Redirect Package Policy for more information about building redirect packages.
The following is an example of a Conary Redirect Recipe:
class Spamassassin(RedirectRecipe): name = 'spamassassin' version = '0' def setup(r): r.addRedirect('perl-Mail-SpamAssassin', 'conary.rpath.com@rpl:devel')
Suggested changes:
- Change the class name to a CamelCase representation of the application name
- Change the value for name to the application name as packaged
- Do not change the value for version because '0' is a common convention for indicating redirects.
- Modify and add r.add lines as necessary to specify other additional components and packages.
Categories: Conary | Packaging | Recipe
