Subject: shared directories
To: None <tech-pkg@netbsd.org>
From: Berndt Josef Wulf <wulf@ping.net.au>
List: tech-pkg
Date: 02/10/2000 00:23:42
G'day,

I'm working on a package which creates a directory which may also be
used by other applications. The problem occures during the
de-install procedure, when this directory gets deleted.

If another application uses this directory, the delete instruction will fail
since it isn't empty. If this directory is empty and not deleted, it
will have an empty entry in KDE's K-Menu.

The solution to this is to delete this directory if empty,
otherwise leave it alone. Is it ok to proceed with the following
trick?

@unexec if test -z `ls -1 %D/share/kde/applnk/Development`; \
          rmdir %D/share/kde/applnk/Development; fi

This checks for an empty directory before an attempt is
made to delete it.

cheerio Berndt
-- 
Name    : Berndt Josef Wulf            | +++ With BSD on Packet Radio +++
E-Mail  : wulf@ping.net.au             |    tfkiss, tnt, dpbox, wampes
ICQ     : 18196098                     |  VK5ABN, Nairne, South Australia 
URL     : http://www.ping.net.au/~wulf | MBOX : vk5abn@vk5abn.#lmr.#sa.au.oc
Sysinfo : DEC AXPpci33+, NetBSD-1.4    | BBS  : vk5abn.#lmr.#sa.aus.oc