Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 50291 - rpm.eclass: rpm_unpack() should not force cwd to $WORKDIR
Summary: rpm.eclass: rpm_unpack() should not force cwd to $WORKDIR
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: Highest enhancement (vote)
Assignee: Alastair Tse (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-05-06 15:24 UTC by Malte S. Stretz
Modified: 2005-06-25 09:05 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Malte S. Stretz 2004-05-06 15:24:24 UTC
I'm currently trying to create an ebuild for a binary app which is shipped as a bunch of .rpms inside a huge .tar.gz. The problem is that rpm_unpack() cds to $WORKDIR before it unpacks/unwraps the .rpms. In this case all files are directly inside the .rpm (without any subdirs) so I end with a totally cluttered $WORKDIR and its impossible to separate the unwrapped stuff from the formely unpacked things.

I kludge around this via calling 'WORKDIR=$PWD rpm_unpack $rpm' but that's not too beautiful.

From rpm_src_unpack()'s POV rpm_unpack() shouldn't need to cd anywhere as that's already done in the calling function. I don't know if any other ebuild relies on this behaviour though.
Comment 1 Mr. Bones. (RETIRED) gentoo-dev 2004-05-06 16:08:16 UTC
liquidx - I agree with this change.  I think rpm_unpack should be modified to not cd before unpacking the rpm since rpm_src_unpack already does it.  There's a couple of places in the portage tree that would need to be verified/modified for this to work, but rpm_unpack should be a more general unpack routine so it can be more easily used with some of the ugly cases for rpms we find in the wild.
Comment 2 Alastair Tse (RETIRED) gentoo-dev 2004-05-07 01:35:53 UTC
as long as the change doesn't impact existing ebuilds, then i have no problems with it ..
Comment 3 Alastair Tse (RETIRED) gentoo-dev 2005-04-26 12:14:31 UTC
i've look at all the ebuilds that use rpm_unpack, and here is a list of ones which  may extract stuff into the wrong place if cd ${WORKDIR} gets removed from rpm_unpack()

media-gfx/maya
dev-lang/icc

yes, thats it. the only change in those packages is to make sure they have moved back to ${WORKDIR} before running rpm_unpack as a transition so that when the corrected rpm.eclass is in portage, they won't break.

then when the rpm.eclass is in portage, they can do whatever they want since rpm_unpack will not be issuing 'cd' any more.
Comment 4 Alastair Tse (RETIRED) gentoo-dev 2005-06-25 09:05:16 UTC
i've verified that icc unpacks correctly with the new changes since the 7.x series has S=${WORKDIR} and 
also 8.x has a mv instruction that just fails, but the rpm is unpacked properly without the mv anymore.

maya i only checked visually, but also in this case ${S} and ${WORKDIR} is the same, so there shouldn't be 
any impact.

so finally i can close this bug. committed new rpm.eclass to portage.