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

Re: Directory 'foo' not empty, so not removed



On Thu, Aug 19, 1999 at 08:31:18AM +0200, Jozef Hitzinger wrote:
> Until now I thought it's just a note to remind me "here we left something"
> and these are conffiles, we want them to survive dpkg -r, so it should
> be ok, no? 
> 
> I can't remember seeing this warning after dpkg --purge.

Yes - it also occurs for --purge, but sometimes (not always)
the directory has already been deleted by the time dpg has finished.

It is my opinion that the current behaviour is correct for directories
without configuration files - you want them to be removed with -r, unless
the user has added other files to that directory. However (correct
me if I am wrong) I don't think is is possible for dpkg to tell the
difference between a configuration file that isn't a conffile and
any other file. Maybe this doesn't matter.

IMHO dpkg should act like follows:

-r:
1. Deletes all dpkg managed files, excluding config files.
2. Deletes all directories no longer contain *any* files.
   Any directories that still exist that shouldn't (ie because they
   still contain files) are kept, and not removed from the dpkg database.
   I don't think any warning is required, as I would consider these
   directories as configuration items, to be removed during --purge.

--purge:
1. Same as step 1, above, but config files are also deleted.
   As an option, dpkg could perhaps delete *.bak files (here
   or step 1 above?).
2. Same as step 2, above.
4. One of three options (user's choice):

   a) If any files/directories still exist, then warn user --purging of
   package has failed and that some files still exist - ie this is the
   most safe, as dpkg doesn't forget about any directories that it has
   installed but cannot delete. This means that the user can manually
   delete the offending file, and re-execute dpkg --purge to remove
   the directories in a safe manner.

   b) If any files/directories still exist, delete them - ie this
   deletes everything, while potentially unsafe, I normally
   delete all of these directories manually anyway. Maybe it wouldn't
   be required nearly as much if *.bak files are deleted in step 1.

   c) If any files/directories still exist, forget about then and purge
   the package - ie this emulates current behaviour. I dislike it, but
   others may disagree.

Maybe this is difficult to implement in current versions of dpkg,
however it is what I would like to see ;-).  It would prevent
dpkg from forgetting about directories that cannot be deleted, unless
the user really wants this to happen. Similarly, it would
still work for configuration files that dpkg doesn't know about
(including ones that the user added manually).

-- 
Brian May <bam@snoopy.apana.org.au>

Attachment: pgpoXAu15xnap.pgp
Description: PGP signature


Reply to: