Subject: Re: DEINSTALL scripts for daemon packages
To: NetBSD Package Tech <>
From: Thomas Klausner <>
List: tech-pkg
Date: 05/25/2001 04:00:11
Mutt made me believe that Greg A. Woods wrote:
> However the `deinstall' script cannot even approach being able to paper
> over a missing `require' script since it has no PRE-DEINSTALL action,
> only a POST-DEINSTALL action.  (thus the nature of this very thread!)

Actually, I don't think this is true. Or anyway, it is exactly as good
as REQ.

If you look at src/usr.sbin/pkg_install/delete/perform.c around line
604, you see that REQ (if it exists) is executed with a DEINSTALL
argument exactly one block before DEINSTALL (if it exists, and is not
ignored by the -D option to pkg_delete) is executed with a DEINSTALL
argument _after_ which we call delete_package().

So DEINSTALL is perfectly capable of replacing REQ in this regard.

> > If a necessary thing, if missing, can be done automatically, it should
> > be, and if it can't, it doesn't matter if INSTALL tells you so or if
> > REQ does, does it?
> Well, not as a user, I guess, though it's much easier to understand if
> you go to look into the implementation.  Certainly for the implementer
> it is much easier to keep things straight with them.  PRE-INSTALL (and
> POST-DEINSTALL) are useful separately in many cases from performing
> requirements checks.

Sorry, we don't seem to have a POST-DEINSTALL right now, neither via
REQ nor via DEINSTALL. The closest thing you can do to work around
this (if you really need it) is to add some @unexec calls to the

So, can we skip discussing the deceased REQ and go back to discussing
what new functionality we need, if we really need any?


Thomas Klausner -