This page explains how to manage coexisting different versions of a same software in ROSA Linux.

Содержание

Policy

When

If any of the following statements are true, you have to introduce a parallel version instead of replacing current one:


How

Naming

So as to allow different versions to coexist, the new one must use a different name. This should be the name of the package, with the major version appended directly. Exceptions:

There should always be a default version, without suffix, so as to have urpmi foo install foo.


Requires

you must add the following requirements to the spec file:

Requires(post):     update-alternatives
Requires(postun):   update-alternatives


Installation

For %postun you need to test for the existence of the alternative in order to allow dropping the alternatively cleanly in the future:

# This is *correct*:
%postun
if [ ! -e %{_bindir}/emacs-nox ]; then
  update-alternatives --remove emacs %{_bindir}/emacs-nox
fi

# This is *wrong*:
%postun
if [ $1 -eq 0 ]; then
  update-alternatives --remove emacs %{_bindir}/emacs-nox
fi

Different scenarios:


Examples

Gimp

gimp and gimp2_2 are in the distro, gimp2_2 is the default.

This is WRONG, the default version of a package should be the simpler one, so that a urpmi gimp always install the default choosen version of a package.

The correct naming would be to have gimp (version 2.2) and gimp1.3.

MySQL

MySQL version 4.0 is in the distro, and you want to include the new development version MySQL-4.1.

The new package should be named MySQL41.

Postgresql

Postgresql 7.4.6 is in the distro, you want to keep it but you want to include, as default, the new postgresql 8.0.

You must rename the old postgresql to postgresql7 (or postgresql74) and use the name 'postgresql' for the new package.


Замечание:
This Policy is based on the Mandriva Alternatives Policy.