On Fri, 2007-06-15 at 11:44 -0400, Havoc Pennington wrote:
The Mugshot client daemon does this itself by installing a file
called
"version" with the package version, and if said file changes it restarts
itself.
The version file doesn't have the RPM release in it, but presumably could.
An advantage of this approach is that it doesn't require magic in the
spec file, though presumably it has downsides too. One downside is that
the restart can be a bit too early (before the upgrade is complete).
We changed a while ago so Mugshot no longer installs the version file as
a normal file .. instead it's %ghost and the end of the %post does:
echo %{version} > %{_datadir}/mugshot/version
Now, there are still a downside: you have to wake up to check for an
upgrade every so often. If you wake up too often, you drain power.
If you wake up less often, it might be a while before you switch
versions, so the desktop component needs to be robust against that.
(Doesn't try to read a file that gets removed in the newer version, say)
For Mugshot, we know when we've told the user to go get a new version,
so we check more frequently for a while after that.
- Owen