Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Debian Development (http://www.linux-archive.org/debian-development/)
-   -   rm -rf /usr/somedir in maintainer scripts? (was: dpkg, symlinks, directories) (http://www.linux-archive.org/debian-development/708424-rm-rf-usr-somedir-maintainer-scripts-dpkg-symlinks-directories.html)

Nikolaus Rath 09-29-2012 10:56 PM

rm -rf /usr/somedir in maintainer scripts? (was: dpkg, symlinks, directories)
 
"Andrej N. Gritsenko" <andrej@rep.kiev.ua> writes:
> I've solved that in the
> preinst script by 'rm -rf /usr/include/libfm' and I thought yet that was
> a right step since upgrade 1.0.1 -> 1.0.2 went smooth.

Somehow that sounds like a really bad idea to me. Admittedly manually
placing some file in /usr/include/libfm is pretty ugly, but I would
still certainly not expect that upgrading the libfm package would remove
it.

Is that really good practice? Can packages "own" a directory, so that
anything that the local admin puts there may be removed automatically?

Best,

-Nikolaus

--
»Time flies like an arrow, fruit flies like a Banana.«

PGP fingerprint: 5B93 61F8 4EA2 E279 ABF6 02CF A9AD B7F8 AE4E 425C


--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 87fw605th5.fsf_-_@vostro.rath.org">http://lists.debian.org/87fw605th5.fsf_-_@vostro.rath.org

"Andrej N. Gritsenko" 09-29-2012 11:12 PM

rm -rf /usr/somedir in maintainer scripts? (was: dpkg, symlinks, directories)
 
Hello!

Nikolaus Rath has written on Saturday, 29 September, at 18:56:
>"Andrej N. Gritsenko" <andrej@rep.kiev.ua> writes:
>> I've solved that in the
>> preinst script by 'rm -rf /usr/include/libfm' and I thought yet that was
>> a right step since upgrade 1.0.1 -> 1.0.2 went smooth.

>Somehow that sounds like a really bad idea to me. Admittedly manually
>placing some file in /usr/include/libfm is pretty ugly, but I would
>still certainly not expect that upgrading the libfm package would remove
>it.

>Is that really good practice? Can packages "own" a directory, so that
>anything that the local admin puts there may be removed automatically?

Probably I'm wrong in that. Do you think preinst script should fail
instead if target-to-replace directory is not empty?

Andriy.


--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20120929231253.GB26771@rep.kiev.ua">http://lists.debian.org/20120929231253.GB26771@rep.kiev.ua

"Andrej N. Gritsenko" 09-29-2012 11:26 PM

rm -rf /usr/somedir in maintainer scripts? (was: dpkg, symlinks, directories)
 
Hello!

I have written on Sunday, 30 September, at 2:12:
>Nikolaus Rath has written on Saturday, 29 September, at 18:56:
>>"Andrej N. Gritsenko" <andrej@rep.kiev.ua> writes:
>>> I've solved that in the
>>> preinst script by 'rm -rf /usr/include/libfm' and I thought yet that was
>>> a right step since upgrade 1.0.1 -> 1.0.2 went smooth.

>>Somehow that sounds like a really bad idea to me. Admittedly manually
>>placing some file in /usr/include/libfm is pretty ugly, but I would
>>still certainly not expect that upgrading the libfm package would remove
>>it.

>>Is that really good practice? Can packages "own" a directory, so that
>>anything that the local admin puts there may be removed automatically?

> Probably I'm wrong in that. Do you think preinst script should fail
>instead if target-to-replace directory is not empty?

And that will not work certainly. If package is being upgraded then old
files will be still in place so rmdir will fail in any case.

Could you propose any better way to do then? Postinst script which does
rmdir and makes symlink instead of not-installed from package? Isn't it
dirty somehow?

Andriy.


--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20120929232630.GC26771@rep.kiev.ua">http://lists.debian.org/20120929232630.GC26771@rep.kiev.ua

martin f krafft 09-30-2012 06:51 AM

rm -rf /usr/somedir in maintainer scripts? (was: dpkg, symlinks, directories)
 
also sprach Nikolaus Rath <Nikolaus@rath.org> [2012.09.30.0056 +0200]:
> > preinst script by 'rm -rf /usr/include/libfm' and I thought yet
> > that was a right step since upgrade 1.0.1 -> 1.0.2 went smooth.
>
> Somehow that sounds like a really bad idea to me. Admittedly
> manually placing some file in /usr/include/libfm is pretty ugly,
> but I would still certainly not expect that upgrading the libfm
> package would remove it.

Do not mess with /usr, that is exclusively the domain of dpkg. Any
file you place there may well be overridden. Use dpkg-divert if you
have to.

--
.'`. martin f. krafft <madduck@d.o> Related projects:
: :' : proud Debian developer http://debiansystem.info
`. `'` http://people.debian.org/~madduck http://vcs-pkg.org
`- Debian - when you have better things to do than fixing systems

"a warm bed in a house sounds a mite better
than eating a hot dog on a stick
with an old geezer traveling on a lawn mower."
-- alvin straight (the straight story)


All times are GMT. The time now is 01:44 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.