automake
[Top][All Lists]
Advanced

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

Re: FEATURE REQUEST: make uninstall should delete empty directories.


From: Eric Siegerman
Subject: Re: FEATURE REQUEST: make uninstall should delete empty directories.
Date: Tue, 2 Mar 2004 17:00:14 -0500
User-agent: Mutt/1.2.5i

On Tue, Mar 02, 2004 at 08:34:19AM -0600, Bob Friesenhahn wrote:
> If a package supports creating the directory /usr/local (as Automake
> does by default) should this directory be recursively removed if a
> package is uninstalled?

Absolutely not!  (I rather suspect the question was rhetorical,
but I'm answering it anyway :-)

One should only remove an empty directory if it is in some sense
"owned" by the package in question:
    /usr/local/libexec/myPackage - yes
    /usr/local/libexec - no, no, no!

That's the ideal anyway.

The problem is, I doubt that Automake has enough information to
know which directories the package "owns", and which directories
it only "borrows". [1]  So the question is, which is the worse
deviation from the ideal: to delete directories that the package
doesn't own, or to fail to delete ones that it does own?  IMO,
the former is far worse -- it risks losing important information
(manually adjusted permissions and ownership of the directories
in question), whereas the latter just leaves around harmless
clutter.

Thus, if I'm right that Automake doesn't know which directories
the package owns, it should should err on the side of caution: it
should *not* try to delete any empty directories at uninstall
time.  Neither should Automake try to guess -- guesses involving
the "rm" command, especially as root, are a really dangerous
idea!

Note that this issue is orthogonal to the question of creating a
standalone uninstall script, which I actually find very
appealing.


[1] By contrast, things like RPM *do* have enough information: if
    a directory is (or becomes) empty during uninstall, it should
    be removed iff it is mentioned in the RPM spec file.  Note
    that the spec file is (intended to be) hand-written, or at
    least hand-tuned; so decisions about which directories to
    list in it are made by a human, not by code.

--

|  | /\
|-_|/  >   Eric Siegerman, Toronto, Ont.        address@hidden
|  |  /
It must be said that they would have sounded better if the singer
wouldn't throw his fellow band members to the ground and toss the
drum kit around during songs.
        - Patrick Lenneau




reply via email to

[Prev in Thread] Current Thread [Next in Thread]