[Fedora-packaging] alternatives --force (removing an old init script)

Ricardo Rocha ricardo.rocha at cern.ch
Mon Mar 26 14:04:41 UTC 2012


Hi.

Thanks, that does work - i was going to swear i had tried it. I do the
check for both file existing and not being a symlink.

Maybe it would be useful to add the --force option, i'll submit a
request to see.

Thanks again,
  Ricardo

On Mon, Mar 26, 2012 at 3:10 PM, Rex Dieter <rdieter at math.unl.edu> wrote:
> On 03/26/2012 08:05 AM, Ricardo Rocha wrote:
>>
>> (resending after subscribing to the list)
>>
>> Hi all.
>>
>> The lcgdm packages are using alternatives, as several flavors are
>> provided - mysql, postgresql, ... backends.
>>
>> While trying to provide an upgrade path to some of our users taking
>> legacy packages - as in from other repositories, not fedora - by using
>> obsoletes/provides i've bumped into an issue with the upgrade of the
>> init scripts. The old packages are not using alternatives, so the
>> init.d script is an actual file, not a symlink. While upgrading to the
>> new fedora package (which would obsolete/provide the old ones), the
>> old init.d script is left there, as it's a real file. This breaks the
>> service as the daemon binaries are now (as they should) in /usr/sbin -
>> they used to go in /usr/bin.
>>
>> Debian seems to provide an option for these cases:
>> # man update-alternatives
>> """
>> If some real file is installed where an alternative link has to be
>> installed, it is kept unless --force is used.
>> """
>>
>> but i can't find anything similar in Fedora. Is there a solution other
>> than documenting that people should remove the old package and install
>> the new one in two steps?
>
>
> Why not just test if the target is a symlink or not prior to the
> update-alternatives call (and remove or rename it as you see fit, so it no
> longer would interfere)?
>
> -- rex
>
> --
> packaging mailing list
> packaging at lists.fedoraproject.org
> https://admin.fedoraproject.org/mailman/listinfo/packaging


More information about the packaging mailing list