Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 368353 - app-portage/eix crash with [ -d /etc/portage/make.conf ]
Summary: app-portage/eix crash with [ -d /etc/portage/make.conf ]
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Martin Väth
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-22 15:12 UTC by James Broadhead
Modified: 2011-08-17 17:42 UTC (History)
2 users (show)

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


Attachments
Patch to prevent mmaping of dirs (eix-fix-dir-map.patch,362 bytes, patch)
2011-05-22 16:08 UTC, Michael Orlitzky
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description James Broadhead 2011-05-22 15:12:39 UTC
$> mkdir /etc/portage/make.conf
$> eix FOO
>> bool VarsReader::read(const char*): Can't map file '/etc/portage/make.conf'
$> eix-update
>> Reading Portage settings ..
>> bool VarsReader::read(const char*): Can't map file '/etc/portage/make.conf'

eix should gracefully handle this situation, or print a warning to cerr and continue (or fail with an appropriate error message)

Reproducible: Always
Comment 1 Michael Orlitzky gentoo-dev 2011-05-22 16:08:46 UTC
Created attachment 274289 [details, diff]
Patch to prevent mmaping of dirs

Without knowing what that code is supposed to do, this seems to fix it.
Comment 2 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2011-05-24 01:25:20 UTC
Hi, what use case is there for /etc/portage/make.conf/ ?
Comment 3 Martin Väth 2011-05-24 08:09:13 UTC
(In reply to comment #2)
> Hi, what use case is there for /etc/portage/make.conf/ ?

I would be also interested in that: If portage would support it, there would
definitely be some use cases, and eix should also support it.
However, I just tried and saw that also portage does not support it
(and spits a warning).

Since /etc/portage/make.conf being a directory is also considered a
misconfiguration by portage, it appears strange to build extra code into eix
for that situation. I think the generic error message
(Can't map file '/etc/portage/make.conf') is understandable enough for such
a strange misconfiguration.

If portage changes and supports /etc/portage/make.conf as a directory,
then also eix should change, of course.
Comment 4 James Broadhead 2011-05-24 08:53:12 UTC
1./ My use-case is that I created the directory so that I could source common elements from them in my /etc/make.conf. 

(computer1)
echo "source /etc/portage/make.conf/common" >> /etc/make.conf
echo "source /etc/portage/make.conf/computer1-specific" >> /etc/make.conf

(computer2)
echo "source /etc/portage/make.conf/common" >> /etc/make.conf
echo "source /etc/portage/make.conf/computer2-specific" >> /etc/make.conf

I picked the name of the folder to describe its contents, and wasn't expecting that to break eix.


2./ The use-case is irrelevant, programs shouldn't crash when they get into predictable, but unexpected situations. A more graceful reaction would be; 
"WARNING: /etc/portage/make.conf is a directory! This is unsupported, and your USE-flags may be shown incorrectly in the following output"
(eix-output as normal)

Afaik, /etc/portage/make.conf is unsupported by portage; why is it a hard-coded path in eix?
Comment 5 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2011-05-24 12:42:51 UTC
(In reply to comment #4)

> Afaik, /etc/portage/make.conf is unsupported by portage; why is it a hard-coded
> path in eix?

That is not correct. /etc/portage/make.conf (as a file) *is* supported by portage and is the preferred location for make.conf in the future.
Comment 6 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2011-08-17 17:42:23 UTC
I'd suggest using /etc/portage/make.conf.d/ for your custom setup. Closing bug for now.