Michael Stilkerich <[EMAIL PROTECTED]> writes:

> I got yet another question.
> I'd like to call an
>       update-menus --menumethod mymethod --remove

> in the prerm script in order to remove any files generated
> by the menu-method. I can't do this in the postrm script
> since I need another script of the package that is not a
> configuration file.

> Lintian complains that update-menus should probably be called
> from postrm, which is not possible in my case, but does not
> give an explanation of the reasons.

> Should I add an override for this one or is there really a good
> reason why one should not do this from prerm?

I poked around, and my best guess is that update-menus checks to see if
the package is still installed before removing it, so calling update-menus
in the prerm means that it may not remove the menu entry of your package
because the package is, at that point, still installed.

Now, in practice, this will almost never be a problem.  update-menus
backgrounds itself until dpkg is done working (by checking the lock file)
and then runs, and my guess is that dpkg will hold the lock file through
running prerm and then postrm.  So in practice, update-menus would start
working after postrm anyway.  The only case where I can see the wrong
thing happening would be if dpkg died after running the prerm for your
package but before removing your package, and did so in a way that caused
it to not re-run the prerm when things were cleaned up.  Seems rather
unlikely.

So, not really sure what to say in this case.  It's probably worth asking
the menu maintainer if calling it in prerm is safe and if the above logic
is correct.  If it is safe, we can change the lintian warning.

-- 
Russ Allbery ([EMAIL PROTECTED])               <http://www.eyrie.org/~eagle/>


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to