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)
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
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.
anaconda-devel@lists.stg.fedoraproject.org