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

Re: Removing directories in postrm ?



Christian Schwarz:> 
> [Sorry for the late reply...]
> 
> On Sat, 3 Jan 1998, Nicol=E1s Lichtmaier wrote:
> 
> > > A few of python's postinst scripts byte-compile the source files they 
> > > install. The byte-compiled files are to be removed by the postrm scripts
> > > (a script removes all byte-compiled files where sources can't be found)
> > > Now if the python package had created a new directory, this directory is
> > > not empty until after postrm and won't be removed therefore.
> > > Should I keep this procedure and perhaps try to remove the directory in
> > > postrm with something like "(rmdir /usr/lib/python1.5/lib-tk 2>/dev/null
> > > || true)" ? The user still will get a warning about the non-empty
> > > directory.
> > >
> > > Should I come up with a solution that tries to remove the byte-compiled
> > > files in the prerm ? (I had to keep track of the files that were created
> > > in postinst).

IIRC python's recompilation logic is based on timestamps
(what else it could be?) and this creates possibility
of error if byte-compiled files are not removed when
souce files are. I believe you are trying to handle this 
correctly.

There is another point, though, and I'm not sure if
you have considered this. IIRC there was a python
upgrade where user was required to remove byte-compiled 
files to ensure recompilation. I think there was some
incompatibility in virtual machine. As a consequence
I think *all* byte-compiled files should be removed on
removal of python interpreter. 

This includes all directories under control of python 
packages, even if files were placed there by user
or some non-Debian package.

> > > Or should I include the byte-compiled files in the packages ?

IF my second point is valid then including byte-compiled 
files in the packages would not solve anything.

> >  If that directory contains files generted in package's postinst, I think
> > you should also create that directory there, and remove it in postrm.
> 
> Best solution would IMHO be to include the (empty) directory in the
> package tree so that dpkg takes care of creating and removing the
> directory. Then, you can generate the byte-compiled files in the postinst
> script and should remove them in the prerm script (not postrm!).
> 
> This way, the directory will not be wiped away if some other package (or
> the sysadmin) placed some files there.

Not removing non-package source files is ok, and required,
and it is also ok to issue warnings in this case, I think.

t.aa


--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
debian-devel-request@lists.debian.org . 
Trouble?  e-mail to templin@bucknell.edu .


Reply to: