[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Triggers and packages that obsolete others



I have a special package that updates various aspects of the system configuration. This package relies heavily on triggers; it has a lot of

%triggerin -- somepackage
<Configure somepackage>

%triggerun -- somepackage
if [ $1 = 0 ]
then
  <Unconfigure somepackage>
fi

I have now seen found it necessary to rename this package, so I have updated Name: and also added Obsoletes: %{_oldname}
Provides: %{_oldname}


Where _oldname is set to the name of the package (well, obviously.)

This creates a problem for the triggers. When the new package is installed, the old one is removed automatically, which is what I want, but this also means that its triggerun is executed with $1 set to 0, so that the "unconfigure" commands are called. This happens *after* the accompanying triggerin from the new package is executed, so the config is lost after the update operation.

Is there any way around this? Can I tell rpm that the new package is the same as the old one for the purpose of calculating arguments to preun/postun/triggerun (so that $1 would be set to 1 instead of 0 during the upgrade operation)? I guess I could use '%triggerpostun -- %{_oldname}' to re-introduce whatever is lost, but that would require a lot of work - unless I could mark the same scriptlet as triggerin and triggerpostun.
--
- Toralf





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index] []