Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 15929 - "ebuild install" may run ebuilds in home dirs instead of ${S}
Summary: "ebuild install" may run ebuilds in home dirs instead of ${S}
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Unclassified (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Nicholas Jones (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-02-18 10:53 UTC by Enrico Morelli
Modified: 2011-10-30 22:19 UTC (History)
4 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 Enrico Morelli 2003-02-18 10:53:30 UTC
If I run 
# ebuild gshield-2.8-r1.ebuild install 
from /usr/portage/net-misc/gshield, the program copy all files from my home
directory in the image tree.
I solved the problem including into ebuild the following lines:

S=${WORKDIR}/${P}


before DESCRIPTION and like first line of src_install():

cd ${S}
Comment 1 chouser (RETIRED) gentoo-dev 2003-02-18 15:17:32 UTC
I think this is actually user error.  This problem only happens when the source is not unpacked before install, which results in no ${S} dir existing, so portage (apparently) cd's to the user's home dir instead.  This can only happen when the user specifically chooses FEATURES="noauto" and uses ebuild instead of emerge.  Simply doing "cd ${S}" doesn't actually fix the problem, as the install will still be attempted without any sources there to install.

I am reassigning this but to "Portage."  The portage devs can then decide what we should do.  The only reasonable options I see are:

1) fix nothing and classify all future bugs like this as user error
2) put some kind of check and/or warning into portage.

--Chouser <chouser@gentoo.org>
Comment 2 SpanKY gentoo-dev 2003-02-18 15:58:43 UTC
if ${S} does not exist when you enter src_install and you have FEATURES=noauto, 
then src_install will start off in whatever directory you ran `ebuild` from ... this behavior 
is listed in the manpage ... 
 
nick: maybe better behavior is to have 'cd ${S} || die' instead of '[ -d ${S} ] && cd ${S}' 
... that way the ebuild has to have a valid ${S}, even if they set it to just ${WORKDIR} 
in the ebuild ... 
i dont see this as 'undesired behavior' ... but rather as a requirement ... 
Comment 3 Enrico Morelli 2003-02-19 06:34:37 UTC
I used ebuild only to test why emerge gshield didn't work.
Infact, if I run  like root
# emerge gshield
I have some errors of files not found, and in the final installation directory
(/etc/gshield) I have all files that I have in the root home directory (!!!)
with some files of gshield.

After this step, I tried to use ebuild to understand the problem.

ENrico
Comment 4 Nicholas Jones (RETIRED) gentoo-dev 2003-02-20 15:58:35 UTC
fixed in cvs... Was a typo that only affected noauto users.
Comment 5 Nicholas Jones (RETIRED) gentoo-dev 2003-02-22 07:58:47 UTC
out shortly