Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Debian User (http://www.linux-archive.org/debian-user/)
-   -   Don't delete cached packages with %posttrans (http://www.linux-archive.org/debian-user/91331-dont-delete-cached-packages-posttrans.html)

Will Woods 05-19-2008 10:26 PM

Don't delete cached packages with %posttrans
 
Given the following:

1) Anaconda removes packages from the cache after they are installed.
2) Anaconda runs package scripts by pulling them from the package files.
3) PreUpgrade works like an HTTP install where all the packages are
already cached.

Guess what happens when we try to run the %posttrans script in the
kernel RPM? Yep: we've deleted the kernel package, so then anaconda
prompts you to bring up the network so it can download it again to get
the script.

The attached patch *should* make anaconda skip package deletion *iff*
the package has a %posttrans script. Two caveats:

1) I'm not sure where the cache lives during regular HTTP installs. If
it's in memory, we probably don't want to leave the kernel package
sitting in RAM for the rest of the install. So this patch might need to
be modified so the condition is:
if flags.cmdline.has_key("preupgrade") and hdr[rpm.RPMTAG_POSTTRANS]:
but I'm not sure.

2) I wish I could say I've tested this patch but I've botched three
attempts in the past three hours. I'm sending it to the list anyway, to
get some discussion and inspection and I'll try testing it again
tomorrow.

-w

(ps thanks for helping me figure this out, Jeremy)
_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

Jeremy Katz 05-20-2008 02:10 AM

Don't delete cached packages with %posttrans
 
On Mon, 2008-05-19 at 18:26 -0400, Will Woods wrote:
> The attached patch *should* make anaconda skip package deletion *iff*
> the package has a %posttrans script. Two caveats:

This is incredibly lame and all but guaranteed to lead to "wtf is this
for? Delete" sometime later in life. Even with a comment.

The right thing is to fix rpm not paper over deficiencies in anaconda

Jeremy

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

John Summerfield 05-20-2008 05:09 AM

Don't delete cached packages with %posttrans
 
Jeremy Katz wrote:

On Mon, 2008-05-19 at 18:26 -0400, Will Woods wrote:

The attached patch *should* make anaconda skip package deletion *iff*
the package has a %posttrans script. Two caveats:


This is incredibly lame and all but guaranteed to lead to "wtf is this
for? Delete" sometime later in life. Even with a comment.

The right thing is to fix rpm not paper over deficiencies in anaconda


_I_ would like the packages to be kept in yum's regular cache. Users
wanting to remove them can do so later, using "yum clean."


My preference would be expressed by just deleting those four lines,
adding none.



--

Cheers
John

-- spambait
1aaaaaaa@coco.merseine.nu Z1aaaaaaa@coco.merseine.nu
-- Advice
http://webfoot.com/advice/email.top.php
http://www.catb.org/~esr/faqs/smart-questions.html
http://support.microsoft.com/kb/555375

You cannot reply off-list:-)

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list


All times are GMT. The time now is 04:32 PM.

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