FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Fedora Development

 
 
LinkBack Thread Tools
 
Old 08-19-2008, 06:37 AM
"Martin Langhoff"
 
Default rpm -- cleaning up conflicting stray files in %pre ineffective?

On Tue, Aug 19, 2008 at 6:16 PM, Martin Langhoff
<martin.langhoff@gmail.com> wrote:
> I am dealing with cleaning up after a really misbehaved package

to clarify a couple of points that may not be clear...

- I already have new package that installs files sanely

- I am trying to provide %pre that cleans up the mess before the
install to protect early users from pain...

If it is absolutely not doable, I can pull out the cleanup code to an
external script, and make a release note saying "run the script".
However, users don't read release notes.

btw, the package spec file is here - follow the link and burn your
eyes... http://dev.laptop.org/git?p=projects/xs-config;a=blob;f=xs-config.spec.in;h=006af0fa0fe9ef528f054b72d29ef569e 54a1d67;hb=HEAD

cheers,


m
--
martin.langhoff@gmail.com
martin@laptop.org -- School Server Architect
- ask interesting questions
- don't get distracted with shiny stuff - working code first
- http://wiki.laptop.org/go/User:Martinlanghoff

--
fedora-devel-list mailing list
fedora-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-devel-list
 
Old 08-19-2008, 08:35 AM
"Bill Crawford"
 
Default rpm -- cleaning up conflicting stray files in %pre ineffective?

2008/8/19 Martin Langhoff <martin.langhoff@gmail.com>:

> I suspect that at install/upgrade time rpm computes the conflicts
> _before_ %pre runs.

Well, it has to, doesn't it? It needs to be able to bail out before
changing anything.

Your options look to me like:

- make a new package that has files in /here.go.files/ but does not
symlink them, and have that remove the symlinks in %post

- remove the symlinks and rename the .rpmnew files in %post

- declare the symlinks as being config (and they should become
.rpmsave, rather than your new ones becoming .rpmnew, I think;
hopefully someone will correct me if I'm wrong).

--
fedora-devel-list mailing list
fedora-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-devel-list
 
Old 08-19-2008, 11:01 AM
Panu Matilainen
 
Default rpm -- cleaning up conflicting stray files in %pre ineffective?

On Tue, 19 Aug 2008, Martin Langhoff wrote:


Hi,

I am dealing with cleaning up after a really misbehaved package that
instead of installing files to their actual destination, it installed
them in a /here.go.files/ tree and them symlinked them in %post . This
means that the files are in place, but "undeclared" from rpm's POV.

This symlinking only affects ~50 paths, so my strategy has been to

- in %pre walk the list of 'bad links' paths, and remove those that are symlink
- install the file with normal rpm means, declare it in spec, etc

However, this does not seem to work. During upgrades I get 'warning:
/path/foo created as /path/foo.rpmnew'. After the install is complete,
/path/foo does not exist however, so we are left with only
/path/foo.rpmnew.

I suspect that at install/upgrade time rpm computes the conflicts
_before_ %pre runs.

Any hints?


%pretrans runs before the conflicts calculations. You just need to be very
careful not to make assumptions about the installation environment: on
initial install (chroot installs, anaconda...) the environment where
%pretrans runs will be completely empty, not even shell is present there.
The only thing that can reliably run on %pretrans is embedded Lua (ie
%pretrans -p <lua>) and you can only use what the embedded Lua offers for
path/file manipulation. You probably don't want to go this way, unless
you're really desperate


- Panu -

--
fedora-devel-list mailing list
fedora-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-devel-list
 
Old 08-19-2008, 10:36 PM
"Martin Langhoff"
 
Default rpm -- cleaning up conflicting stray files in %pre ineffective?

On Tue, Aug 19, 2008 at 8:35 PM, Bill Crawford
<billcrawford1970@gmail.com> wrote:
> 2008/8/19 Martin Langhoff <martin.langhoff@gmail.com>:
>
>> I suspect that at install/upgrade time rpm computes the conflicts
>> _before_ %pre runs.
>
> Well, it has to, doesn't it? It needs to be able to bail out before
> changing anything.

Sounds reasonable. I'm not familiar enough with the RPM internals to
understand when each hook is called, and that key steps are happening
between... is this explained anywhere - short if reading the src?

> Your options look to me like:
>
> - make a new package that has files in /here.go.files/ but does not
> symlink them, and have that remove the symlinks in %post
>
> - remove the symlinks and rename the .rpmnew files in %post

I'll probably do this. Thanks for the hint...

> - declare the symlinks as being config (and they should become
> .rpmsave, rather than your new ones becoming .rpmnew, I think;
> hopefully someone will correct me if I'm wrong).

I cannot :-/ Part of the problem is that this is a package that was
clobbering other packages' conffiles in %post . Evil spawn.

The new-and-improved version I have is much saner, but still ends up
clobbering a couple of conffiles. As you can imagine - it's not for
inclusion in Fedora proper.

(Wherever possible it uses conf.d type facilities. And several of the
files being clobbered are the /etc/sysconfig/<service> files to point
the daemon to an alternative config file. Still, somewhat ugly.)

On Tue, Aug 19, 2008 at 11:01 PM, Panu Matilainen
<pmatilai@laiskiainen.org> wrote:
> %pretrans runs before the conflicts calculations(...) embedded Lua

Wow! Now that's an interesting tidbit. Hmmm, Lua...

cheers,



m
--
martin.langhoff@gmail.com
martin@laptop.org -- School Server Architect
- ask interesting questions
- don't get distracted with shiny stuff - working code first
- http://wiki.laptop.org/go/User:Martinlanghoff

--
fedora-devel-list mailing list
fedora-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-devel-list
 

Thread Tools




All times are GMT. The time now is 07:05 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org