Re: purging: what should be deleted ?
On 11-Apr-99, 10:29 (CDT), Christian Hammers <firstname.lastname@example.org> wrote:
> Hi !
> I wonder what should be deleted when purging ?
> a) only the config files
> b) config files and empty directories
> c) every directory INCLUDING files that the user may have installed
> (since without the package those files are useless)
> d) config files and empty config-directores and non-config-directories
> even if they include users' data.
My theory is that a package should not delete anything it doesn't own.
A package owns its files (i.e. all the stuff in /usr/bin, /usr/man,
etc.). Dpkg will delete these during --remove.
A package owns its config files, whether or not they are marked as
dpkg conffiles or not. For example, /etc/cern-httpd is not a conffile
(because it is created by a script), but is a config file, and therefore
should be deleted by 'dpkg --purge'.
A package *may* own its log files, assuming that it is the only thing
logging to those files. I think these should also be removed by --purge.
A package owns files it creates.
A package owns its custom directories (/etc/foo), and could delete it
*if it is empty* (although I think dpkg ought to do this, but I'm not
sure if does). If it's not empty, then it shouldn't delete it, because of:
A package should never ever erase any other files.
> I ask because a user of the wwwoffle package I maintain complained that
> it has deleted his private.html which was installed in /etc/wwwoffle.
I agree with the user.
> This is correct. My script does a "rm -rf". But what about the huge
> amount of data in /var/spool/wwwoffle ? Should I left that data ?
> It is not installed by the package...
Is it generated by the package? Or by the user? Consider the difference
between removing stuff under /var/catman and /usr/man.
The basic concept (I think) is that a package should delete something
that the user created, even if it is under directories that are owned by