Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 247227 - eix-0.15.0 cannot find sourced file in etc/make.conf
Summary: eix-0.15.0 cannot find sourced file in etc/make.conf
Status: RESOLVED FIXED
Alias: None
Product: Gentoo/Alt
Classification: Unclassified
Component: Prefix Support (show other bugs)
Hardware: All Linux
: High minor (vote)
Assignee: Martin Väth
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-11-17 16:29 UTC by Jeremy Olexa (darkside) (RETIRED)
Modified: 2008-11-29 12:13 UTC (History)
1 user (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 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2008-11-17 16:29:53 UTC
Martin,
I have a source /path/to/make.conf in my etc/make.conf but eix does not properly find it. Can you shed some light on this? Below is the relevant part of strace:

open("/home/jolexa/portage/linux-64/etc/make.conf", O_RDONLY) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=921, ...}) = 0
mmap(NULL, 921, PROT_READ, MAP_SHARED, 3, 0) = 0x2a95a6f000
close(3)                                = 0
open("/home/jolexa/portage/linux-64/home/jolexa/portage/global/make.conf", O_RDONLY) = -1 ENOENT (No such file or directory)
write(2, "failed to source \'/home/jolexa/p"..., 56failed to source '/home/jolexa/portage/global/make.conf') = 56

The error message is the correct path but the file it tries to open is "double prefixed"

The Gentoo Prefix eix ebuild calls econf like this:
    econf --with-bzip2 $(use_with sqlite) $(use_with doc rst) \
        --with-ebuild-sh-default="/usr/$(get_libdir)/portage/bin/ebuild.sh" \
        --with-eprefix-default="${EPREFIX}" \
        --with-portage-rootpath="${ROOTPATH}"

Thanks for your help here.
Comment 1 Martin Väth 2008-11-17 19:35:57 UTC
The path which is prepended to source commands is that of EPREFIX_SOURCE.
This variable defaults to %{EPREFIX_PORTAGE_EXEC} which is used as the prefix
to all portage binaries (like ebuild or ebuild.sh).
The latter in turn defaults to %{EPREFIX} which in turn defaults to - well,
to the $EPREFIX value during your emerge (passed by ./configure).

Reason: I assumed that if you have prefix-portage installed in $EPREFIX,
then also all source commands will behave analogously to inherit's,
i.e. they will also have implicitly $EPREFIX added by prefix-portage.

If this assumption is false, then EPREFIX_SOURCE should probably better
default to %{EIX_PREFIX}. Of course, you can always make this change locally
(i.e. solve your problem) by putting the line
  EPREFIX_SOURCE="%{EIX_PREFIX}"
into /etc/eixrc.

However, eix should of course have sane defaults. Therefore, I would be
interested to know whether my above assumption was false (and thus
eix defaults need fixing).
Comment 2 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2008-11-17 19:54:54 UTC
(In reply to comment #1)

> Reason: I assumed that if you have prefix-portage installed in $EPREFIX,
> then also all source commands will behave analogously to inherit's,
> i.e. they will also have implicitly $EPREFIX added by prefix-portage.

No, that is incorrect. You are comparing $EPREFIX to a chroot, which is not the same. If a Prefix user has layman installed, they will append to make.conf like so:

 * If this is the very first overlay you add with layman,
 * you need to append the following statement to your
 * /home/jolexa/portage/linux-64/etc/make.conf file:
 * 
 * source /home/jolexa/portage/linux-64/usr/local/portage/layman/make.conf

So, the reasoning here is that Gentoo Prefix is just a 'prefix' ($EPREFIX) where all executables, etc are. So, my path to bash for example is:
%% type -P bash
/home/jolexa/portage/linux-64/bin/bash
and I can call that from wherever I am, I don't need to chroot to /home/jolexa/portage/linux-64 or anything like that. Which is why inherit() works (because we make it - just a wrapper function in ebuild.sh) and why source() does not work like that (because we can't and/or won't)


> 
> If this assumption is false, then EPREFIX_SOURCE should probably better
> default to %{EIX_PREFIX}. Of course, you can always make this change locally
> (i.e. solve your problem) by putting the line
>   EPREFIX_SOURCE="%{EIX_PREFIX}"
> into /etc/eixrc.
> 
> However, eix should of course have sane defaults. Therefore, I would be
> interested to know whether my above assumption was false (and thus
> eix defaults need fixing).

I think the defaults should indeed be altered, does it make more sense after the above explanation?
Comment 3 Martin Väth 2008-11-17 20:26:41 UTC
I fail to see a difference between an "executable" and e.g. a sourced bash
file, but I respect of course that prefix-portage distinguishes this and
changed the default in the eix svn trunk (>=eix-0.15.2) to %{EIX_PREFIX}.
(Since EIX_PREFIX is treated throughout like a new root, this is then the
correct value for the new default IMHO).
Comment 4 Fabian Groffen gentoo-dev 2008-11-17 22:16:14 UTC
(In reply to comment #3)
> I fail to see a difference between an "executable" and e.g. a sourced bash
> file, but I respect of course that prefix-portage distinguishes this and
> changed the default in the eix svn trunk (>=eix-0.15.2) to %{EIX_PREFIX}.
> (Since EIX_PREFIX is treated throughout like a new root, this is then the
> correct value for the new default IMHO).

The problem is that there is no way to have an arbitrary script or text being found under some fixed offset.  For binaries we just have a search path.

I think the confusion comes from using absolute paths with executables.  Think Prefix as your /usr/local/bin package manager, and then see if it still makes sense that 'source' adds some magical path.  (And in reverse, what would be made impossible to do if it would!)
Comment 5 Martin Väth 2008-11-29 12:13:42 UTC
Closing since eix-0.15.2 (with changed default) is in the tree