Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 193077 - app-portage/layman einfo is not POSIX compliant
Summary: app-portage/layman einfo is not POSIX compliant
Status: VERIFIED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Linux bug wranglers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-09-19 15:59 UTC by Mathias Laurin
Modified: 2007-09-20 09:31 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 Mathias Laurin 2007-09-19 15:59:00 UTC
emerging layman comes with the following message
 * you need to append the following statement to your
 * /etc/make.conf file:
 * 
 * source /usr/portage/local/layman/make.conf

however, source is not POSIX, it should read instead

 * you need to append the following statement to your
 * /etc/make.conf file:
 * 
 * . /usr/portage/local/layman/make.conf

"dot" /usr/port.....

this is relevant to using baselayout-2 and symlinking sh to dash (for example), in which case, source does not exist.

Reproducible: Always

Steps to Reproduce:
1. upgrade to baselayout-2*
2. cd /bin && unlink sh && ln -s dash sh
3. emerge layman
4. follow the instructions on the screen
Actual Results:  
emerge-ing any packet will report an error in /etc/make.conf and the config file from layman will not actually be sourced.



The einfo (or better an ewarn) should also advertise to change the source to . (dot) as it will keep working on bash and on any POSIX shell.
Comment 1 Matthias Schwarzott gentoo-dev 2007-09-19 16:06:59 UTC
Doesn't portage explicitly uses bash to do its work (and also to read make.conf) ?
Comment 2 Tom Knight (RETIRED) gentoo-dev 2007-09-19 16:21:47 UTC
Portage actually uses the shlex python module to read your make.conf not bash or /bin/sh and is set to use the keyword source to source files.
Comment 3 Mathias Laurin 2007-09-19 16:31:29 UTC
(In reply to comment #1)
> Doesn't portage explicitly uses bash to do its work (and also to read
> make.conf) ?
> 

I think so, but it becomes impossible to source /etc/make.conf from /bin/sh...
Comment 4 Mathias Laurin 2007-09-19 16:32:46 UTC
(In reply to comment #2)
> Portage actually uses the shlex python module to read your make.conf not bash
> or /bin/sh and is set to use the keyword source to source files.
> 

OK, so the variables in there are not supposed to be used in a shell script, anyway, right? Is it not a bug?
Comment 5 Mathias Laurin 2007-09-19 16:46:14 UTC
I still think it is broken if it cannot be sourced with /bin/sh, even if it is on purpose. 

So yes, the error was not where I though it was and the only fix is to have layman update /etc/make.conf (or copy the content of /usr/.../layman/make.conf it by hand) apparently.

Is it REALLY the way it is supposed to be?
Comment 6 Tom Knight (RETIRED) gentoo-dev 2007-09-19 20:52:11 UTC
The shell side of things in portage (ebuilds, eclasses, /usr/lib/portage/bin/ebuild.sh) use /bin/bash not /bin/sh. Portage expects its shell environment to be bash (and there are likely to be many non-baselayout bashisms scattered around).

As /etc/make.conf is a portage config file it should be sourceable by bash as that's the shell we use for the ebuild environment. I don't see this changing in the near (or distant) future unless someone provides patches for all the places in portage/ebuilds/eclasses where bash is assumed to be the shell.

The output from layman is correct in terms of how portage uses make.conf, so I'm marking this one as invalid again. Basically if you want to be able to source make.conf with dash you'll have to change portage et al to be able to use dash as it's shell environment :)

These links have some more input on the matter:

https://bugs.gentoo.org/show_bug.cgi?id=101416
https://bugs.gentoo.org/show_bug.cgi?id=101486
http://thread.gmane.org/gmane.linux.gentoo.portage.devel/812
Comment 7 Mathias Laurin 2007-09-20 06:47:15 UTC
(In reply to comment #6)

Eh, that's interesting. Thank you for the input. It is always interesting to learn more about Gentoo's guts.