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

Re: [RFD]: Question regarding actions to take on --purge of a package.



>>>>> "Adam" == Adam Heath <doogie@debian.org> writes:

    Adam> What if another pkg installs files into
    Adam> /var/{log,lib}/apache, or, /etc/apache?  Apache's postinst
    Adam> does an rm -rf on those dirs, and this will wipe out the
    Adam> files owned by the other pkg.  libapache-mod-jserv stored
    Adam> data into /etc/apache, however, this pkg has since be
    Adam> renamed to jserv, and stores its config in /etc/jserv.  But
    Adam> there could be other cases of this as well.

If you look at my proposal, it would fix this problem.

Eg, apache would somehow tell dpkg
"I own /etc/apache/{access.conf,httpd.conf,srm.conf}"

package Y would tell dpkg:
"I own /etc/apache/y_thinks_it_is_apache"

When purging apache, dpkg (and not the postinst script) would only
delete the files it knows apache owns. It wouldn't delete any other
file (perhaps an exception could be made for *.bak files).

For instace:
dpkg --purge apache

deletes /etc/apache/{access.conf,httpd.conf,srm.conf}

dpkg --purge Y

deletes /etc/apache/y_thinks_it_is_apache

and then attempts to

(optional step: rm /etc/apache/*.bak????)
rmdir /etc/apache

however, assume other file exists, eg /etc/apache/{counter.log,core}
(which both do exist for some reason on my system).

In this case, dpkg wont delete the directory, but warn the
adminstrator somehow that other files still exist that it doesn't know
about.

    Adam> Would this be a bug on apache?  Or a bug on policy?  This
    Adam> needs to be clarified.

I think it is a bug in dpkg. dpkg support for files that don't exist
in the *.deb package is non-existant, IMHO, and package maintainers
have been forced to hack out solutions in postrm scripts.
-- 
Brian May <bam@debian.org>


Reply to: