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

Re: Removing directories in postrm ?



[Sorry for the late reply...]

On Sat, 3 Jan 1998, Nicolás 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).
> > 
> > Or should I include the byte-compiled files in the packages ?
> 
>  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.

(Note, that I can't comment on whether you should ship byte-compiled files
or compile them on demand. You would have to give us a little more info
about which files these are, how long compilation takes, etc.)


Thanks,

Chris

--          _,,     Christian Schwarz
           / o \__   schwarz@monet.m.isar.de, schwarz@schwarz-online.com,
           !   ___;   schwarz@debian.org, schwarz@mathematik.tu-muenchen.de
           \  /        
  \\\______/  !        PGP-fp: 8F 61 EB 6D CF 23 CA D7  34 05 14 5C C8 DC 22 BA
   \          /         http://fatman.mathematik.tu-muenchen.de/~schwarz/
-.-.,---,-,-..---,-,-.,----.-.-
  "DIE ENTE BLEIBT DRAUSSEN!"


--
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: