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

Re: How to get dpkg to remove directories?

Steve Greenland <steveg@moregruel.net> wrote:

> > But you can (should!) still test for the /usr/lib/foo/mainscript
> > to see if the package is installed. In other words, your
> > /etc/cron.daily/foo does:
> >
> >  test -x /usr/lib/foo/mainscript && exec /usr/lib/foo/mainscript
> >
> > and your /etc/init.d/foo script does (near the top)
> >
> >  test -x /usr/lib/foo/mainscript || exit 0

Splitting the stuff from the cron.daily script to a separate script is
not strictly necessary.  If the script is small, couldn't it be left in
the cron file with the following test to see whether the package is

  test -d /usr/share/doc/foo || exit 0


  test -f /usr/share/doc/foo/copyright || exit 0

where "foo" is the package name.  Every policy compliant package (even
one containing only conffiles) has to have a copyright file, which is
removed by "dpkg --remove".

> > (It probably seems I'm being inconsistent, by encouranging you to
> > "hide" your cron.daily script but then discouraging the same thing
> > for init.d.  But I think I'm describing "common practice", and the
> > first feels ok while the second strikes me as annoying. Hmmm.)

Grant Edwards <grante@visi.com> commented:

> It does seem odd that common practice for /etc/init.d and
> /etc/cron.daily aren't the same.

Depends on the complexity of the script.  Often the init.d script is
simply starting a daemon; a cron script is more likely to do several
tasks.  Thus, common practice is to treat the two differently.

- Brian

To UNSUBSCRIBE, email to debian-devel-request@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

Reply to: