Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 334817 - portage-2.2_rc69 tracebacks with /etc/portage/make.conf/ as a directory
Summary: portage-2.2_rc69 tracebacks with /etc/portage/make.conf/ as a directory
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core - Dependencies (show other bugs)
Hardware: All Linux
: High critical (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords: InVCS, REGRESSION
Depends on:
Blocks:
 
Reported: 2010-08-27 13:05 UTC by Duncan
Modified: 2010-08-28 03:58 UTC (History)
0 users

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 Duncan 2010-08-27 13:05:36 UTC
Severity critical as this entirely broke portage for me.  Tracebacks on pretty much anything portage related, including etc-update, equery list, and emerge --info.

Previously installed portage version 2.2_rc67 doesn't have this issue.  I didn't install rc68.  rc69 has the issue.

My /etc/make.conf consists of a single line (terminated with a line feed, so one could say it's two lines, the second one blank):
source /etc/portage/make.conf/master


/etc/portage/make.conf/master consists of (thru the layman line, IOW, there's a blank line near the end):
source /etc/portage/make.conf/cflags
source /etc/portage/make.conf/collision-ignore
source /etc/portage/make.conf/features
source /etc/portage/make.conf/fs
source /etc/portage/make.conf/jed
source /etc/portage/make.conf/ldflags
source /etc/portage/make.conf/log
source /etc/portage/make.conf/makeopts
source /etc/portage/make.conf/mirrors
source /etc/portage/make.conf/net
source /etc/portage/make.conf/use
source /etc/portage/make.conf/use.expand
source /etc/portage/make.conf/other

source /etc/portage/make.conf/layman

Those files in turn contain the actual config options one might expect.

After upgrading to rc_69, nothing seems to work, everything triggers a traceback.  I did the portage update first, by itself, and discovered the problem when I tried etc-update as it told me there was a file to update at the end of the portage merge.  (The system, ~amd64/no-multilib, was entirely updated --deep --newuse @world a couple weeks ago, including etc-update, revdep-rebuild and --depclean.)

Changing the directory name (and all the source paths with it) to /etc/portage/make (make subdir instead of make.conf) cures the tracebacks, so the problem is definitely the name, make.conf.  Is /etc/portage/make.conf now supposed to be reserved as a filename? (rhetorical, see next)

I see in the portage (5) manpage that it's listed, but it wasn't listed in rc67 (double-checked its manpage, binpkgs make that easy! =:^), and I double-checked the changelogs (which were still in my terminal buffer from checking them before the upgrade) and there's nothing mentioning make.conf in them.  How was I to know about such a change in behavior for /etc/portage, if it wasn't mentioned in the changelogs?  That's why I read them for packages such as portage.

OK, so portage uses /etc/portage/make.conf itself now.  Perhaps make it take /etc/portage/make.conf as a dir, too, much like it already does /etc/portage/package.* files?  Then I should be able to eliminate /etc/make.conf and /etc/portage/make.conf/master entirely, and simply have the files in /etc/portage/make.conf/.

Meanwhile, the make.conf (5) manpage needs a bit more tweaking to account for both /etc/make.conf and /etc/portage/make.conf, now.  In the DESCRIPTION section, it should make the precedence between the two clear, just as it does make.conf against the environment and against make.globals.  In the FILES section, it should again make the order clear and it should mention that it overrides both make.globals and make.defaults. (It mentions only make.defaults, now, which could be confusing since that file's not listed in the FILES section, but make.globals is.)

They're probably not needed now as the problem is found above, but anyway, here are the tracebacks:

equery l portage
open('/etc/portage/make.conf', 'r'): [Errno 21] Is a directory: '/etc/portage/make.conf'
Traceback (most recent call last):
  File "/usr/bin/equery", line 38, in <module>
    equery.main()
  File "/usr/lib64/python2.6/site-packages/gentoolkit/equery/__init__.py", line 343, in main
    expanded_module_name, globals(), locals(), [], -1
  File "/usr/lib64/python2.6/site-packages/gentoolkit/equery/list_.py", line 23, in <module>
    from gentoolkit.helpers import get_installed_cpvs
  File "/usr/lib64/python2.6/site-packages/gentoolkit/helpers.py", line 38, in <module>
    from gentoolkit.dbapi import PORTDB, VARDB
  File "/usr/lib64/python2.6/site-packages/gentoolkit/dbapi.py", line 13, in <module>
    PORTDB = portage.db[portage.root]["porttree"].dbapi
  File "/usr/lib64/portage/pym/portage/proxy/objectproxy.py", line 37, in __getitem__
    return object.__getattribute__(self, '_get_target')()[key]
  File "/usr/lib64/portage/pym/portage/__init__.py", line 573, in _get_target
    return _get_legacy_global(name)
  File "/usr/lib64/portage/pym/portage/_legacy_globals.py", line 34, in _get_legacy_global
    portage.db = portage.create_trees(**kwargs)
  File "/usr/lib64/portage/pym/portage/__init__.py", line 515, in create_trees
    config_incrementals=portage.const.INCREMENTALS)
  File "/usr/lib64/portage/pym/portage/proxy/objectproxy.py", line 31, in __call__
    return result(*args, **kwargs)
  File "/usr/lib64/portage/pym/portage/package/ebuild/config.py", line 685, in __init__
    expand=make_conf) or {})
  File "/usr/lib64/portage/pym/portage/util/__init__.py", line 415, in getconfig
    encoding=_encodings['fs'], errors='strict'), 'rb').read()
IOError: [Errno 21] Is a directory: '/etc/portage/make.conf'

emerge --info portage
open('/etc/portage/make.conf', 'r'): [Errno 21] Is a directory: '/etc/portage/make.conf'
Traceback (most recent call last):
  File "/usr/bin/emerge", line 43, in <module>
    retval = emerge_main()
  File "/usr/lib64/portage/pym/_emerge/main.py", line 1264, in emerge_main
    settings, trees, mtimedb = load_emerge_config()
  File "/usr/lib64/portage/pym/_emerge/actions.py", line 2756, in load_emerge_config
    trees = portage.create_trees(trees=trees, **kwargs)
  File "/usr/lib64/portage/pym/portage/__init__.py", line 515, in create_trees
    config_incrementals=portage.const.INCREMENTALS)
  File "/usr/lib64/portage/pym/portage/proxy/objectproxy.py", line 31, in __call__
    return result(*args, **kwargs)
  File "/usr/lib64/portage/pym/portage/package/ebuild/config.py", line 685, in __init__
    expand=make_conf) or {})
  File "/usr/lib64/portage/pym/portage/util/__init__.py", line 415, in getconfig
    encoding=_encodings['fs'], errors='strict'), 'rb').read()
IOError: [Errno 21] Is a directory: '/etc/portage/make.conf'

sudo etc-update
open('/etc/portage/make.conf', 'r'): [Errno 21] Is a directory: '/etc/portage/make.conf'
Traceback (most recent call last):
  File "/usr/bin/portageq", line 668, in <module>
    main()
  File "/usr/bin/portageq", line 649, in main
    retval = function(args)
  File "/usr/bin/portageq", line 527, in envvar
    print(arg +"='"+ portage.settings[arg] +"'")
  File "/usr/lib64/portage/pym/portage/proxy/objectproxy.py", line 37, in __getitem__
    return object.__getattribute__(self, '_get_target')()[key]
  File "/usr/lib64/portage/pym/portage/__init__.py", line 573, in _get_target
    return _get_legacy_global(name)
  File "/usr/lib64/portage/pym/portage/_legacy_globals.py", line 34, in _get_legacy_global
    portage.db = portage.create_trees(**kwargs)
  File "/usr/lib64/portage/pym/portage/__init__.py", line 515, in create_trees
    config_incrementals=portage.const.INCREMENTALS)
  File "/usr/lib64/portage/pym/portage/proxy/objectproxy.py", line 31, in __call__
    return result(*args, **kwargs)
  File "/usr/lib64/portage/pym/portage/package/ebuild/config.py", line 685, in __init__
    expand=make_conf) or {})
  File "/usr/lib64/portage/pym/portage/util/__init__.py", line 415, in getconfig
    encoding=_encodings['fs'], errors='strict'), 'rb').read()
IOError: [Errno 21] Is a directory: '/etc/portage/make.conf'
open('/etc/portage/make.conf', 'r'): [Errno 21] Is a directory: '/etc/portage/make.conf'
open('/etc/portage/make.conf', 'r'): [Errno 21] Is a directory: '/etc/portage/make.conf'

====================================
Error in portage.process.run_exitfuncs

  File "/usr/lib64/portage/pym/portage/process.py", line 116, in run_exitfuncs
    func(*targs, **kargs)
  File "/usr/lib64/portage/pym/portage/__init__.py", line 499, in portageexit
    mtimedb.commit()
  File "/usr/lib64/portage/pym/portage/proxy/objectproxy.py", line 22, in __getattribute__
    result = object.__getattribute__(self, '_get_target')()
  File "/usr/lib64/portage/pym/portage/__init__.py", line 573, in _get_target
    return _get_legacy_global(name)
  File "/usr/lib64/portage/pym/portage/_legacy_globals.py", line 20, in _get_legacy_global
    CACHE_PATH, "mtimedb")
  File "/usr/lib64/portage/pym/portage/__init__.py", line 225, in __call__
    rval = self._func(*wrapped_args, **wrapped_kwargs)
  File "/usr/lib64/python2.6/posixpath.py", line 67, in join
    elif path == '' or path.endswith('/'):
  File "/usr/lib64/portage/pym/portage/proxy/objectproxy.py", line 76, in __eq__
    return object.__getattribute__(self, '_get_target')() == other
  File "/usr/lib64/portage/pym/portage/__init__.py", line 573, in _get_target
    return _get_legacy_global(name)
  File "/usr/lib64/portage/pym/portage/_legacy_globals.py", line 34, in _get_legacy_global
    portage.db = portage.create_trees(**kwargs)
  File "/usr/lib64/portage/pym/portage/__init__.py", line 515, in create_trees
    config_incrementals=portage.const.INCREMENTALS)
  File "/usr/lib64/portage/pym/portage/package/ebuild/config.py", line 685, in __init__
    expand=make_conf) or {})
  File "/usr/lib64/portage/pym/portage/util/__init__.py", line 415, in getconfig
    encoding=_encodings['fs'], errors='strict'), 'rb').read()
[Errno 21] Is a directory: '/etc/portage/make.conf'
====================================

Error in atexit._run_exitfuncs:
Traceback (most recent call last):
  File "/usr/lib64/python2.6/atexit.py", line 24, in _run_exitfuncs
    func(*targs, **kargs)
  File "/usr/lib64/portage/pym/portage/process.py", line 127, in run_exitfuncs
    exec("raise exc_info[0], exc_info[1], exc_info[2]")
  File "/usr/lib64/portage/pym/portage/process.py", line 116, in run_exitfuncs
    func(*targs, **kargs)
  File "/usr/lib64/portage/pym/portage/__init__.py", line 499, in portageexit
    mtimedb.commit()
  File "/usr/lib64/portage/pym/portage/proxy/objectproxy.py", line 22, in __getattribute__
    result = object.__getattribute__(self, '_get_target')()
  File "/usr/lib64/portage/pym/portage/__init__.py", line 573, in _get_target
    return _get_legacy_global(name)
  File "/usr/lib64/portage/pym/portage/_legacy_globals.py", line 20, in _get_legacy_global
    CACHE_PATH, "mtimedb")
  File "/usr/lib64/portage/pym/portage/__init__.py", line 225, in __call__
    rval = self._func(*wrapped_args, **wrapped_kwargs)
  File "/usr/lib64/python2.6/posixpath.py", line 67, in join
    elif path == '' or path.endswith('/'):
  File "/usr/lib64/portage/pym/portage/proxy/objectproxy.py", line 76, in __eq__
    return object.__getattribute__(self, '_get_target')() == other
  File "/usr/lib64/portage/pym/portage/__init__.py", line 573, in _get_target
    return _get_legacy_global(name)
  File "/usr/lib64/portage/pym/portage/_legacy_globals.py", line 34, in _get_legacy_global
    portage.db = portage.create_trees(**kwargs)
  File "/usr/lib64/portage/pym/portage/__init__.py", line 515, in create_trees
    config_incrementals=portage.const.INCREMENTALS)
  File "/usr/lib64/portage/pym/portage/package/ebuild/config.py", line 685, in __init__
    expand=make_conf) or {})
  File "/usr/lib64/portage/pym/portage/util/__init__.py", line 415, in getconfig
    encoding=_encodings['fs'], errors='strict'), 'rb').read()
IOError: [Errno 21] Is a directory: '/etc/portage/make.conf'
Error in sys.exitfunc:
Traceback (most recent call last):
  File "/usr/lib64/python2.6/atexit.py", line 24, in _run_exitfuncs
    func(*targs, **kargs)
  File "/usr/lib64/portage/pym/portage/process.py", line 127, in run_exitfuncs
    exec("raise exc_info[0], exc_info[1], exc_info[2]")
  File "/usr/lib64/portage/pym/portage/process.py", line 116, in run_exitfuncs
    func(*targs, **kargs)
  File "/usr/lib64/portage/pym/portage/__init__.py", line 499, in portageexit
    mtimedb.commit()
  File "/usr/lib64/portage/pym/portage/proxy/objectproxy.py", line 22, in __getattribute__
    result = object.__getattribute__(self, '_get_target')()
  File "/usr/lib64/portage/pym/portage/__init__.py", line 573, in _get_target
    return _get_legacy_global(name)
  File "/usr/lib64/portage/pym/portage/_legacy_globals.py", line 20, in _get_legacy_global
    CACHE_PATH, "mtimedb")
  File "/usr/lib64/portage/pym/portage/__init__.py", line 225, in __call__
    rval = self._func(*wrapped_args, **wrapped_kwargs)
  File "/usr/lib64/python2.6/posixpath.py", line 67, in join
    elif path == '' or path.endswith('/'):
  File "/usr/lib64/portage/pym/portage/proxy/objectproxy.py", line 76, in __eq__
    return object.__getattribute__(self, '_get_target')() == other
  File "/usr/lib64/portage/pym/portage/__init__.py", line 573, in _get_target
    return _get_legacy_global(name)
  File "/usr/lib64/portage/pym/portage/_legacy_globals.py", line 34, in _get_legacy_global
    portage.db = portage.create_trees(**kwargs)
  File "/usr/lib64/portage/pym/portage/__init__.py", line 515, in create_trees
    config_incrementals=portage.const.INCREMENTALS)
  File "/usr/lib64/portage/pym/portage/package/ebuild/config.py", line 685, in __init__
    expand=make_conf) or {})
  File "/usr/lib64/portage/pym/portage/util/__init__.py", line 415, in getconfig
    encoding=_encodings['fs'], errors='strict'), 'rb').read()
IOError: [Errno 21] Is a directory: '/etc/portage/make.conf'
Scanning Configuration files...
Exiting: Nothing left to do; exiting. :)
Comment 1 Zac Medico gentoo-dev 2010-08-27 16:43:43 UTC
I was planning to eventually have /etc/portage/make.conf be new default location for make.conf, so it's supported in addition to /etc/make.conf now.

I'll fix it to handle the error that you got. I'm not yet sure about adding 'make.conf as directory' support though.

For now, I'd suggest renaming your /etc/portage/make.conf/ directory to /etc/portage/make.conf.d/.
Comment 2 Zac Medico gentoo-dev 2010-08-27 16:55:32 UTC
(In reply to comment #1)
> I'll fix it to handle the error that you got.

This turns the error into a warning:

http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=a3f3d939562f8d2ef822a1002311ae6c05e93c78
Comment 3 Duncan 2010-08-27 20:37:08 UTC
(In reply to comment #2)
> (In reply to comment #1)
> > I'll fix it to handle the error that you got.
> 
> This turns the error into a warning

Thanks.  Looks good and the new location makes sense.  And fast turn around! =:^)

You didn't mention the manpage changes I suggested.  Did you miss that or just not get to them yet?  (No problem if the latter, just don't want them to be missed.)  Should I file that as a different bug?
Comment 4 Zac Medico gentoo-dev 2010-08-27 21:18:56 UTC
(In reply to comment #3)
> You didn't mention the manpage changes I suggested.  Did you miss that or just
> not get to them yet?  (No problem if the latter, just don't want them to be
> missed.)  Should I file that as a different bug?

Sorry, I missed that. I've documented the override behavior in make.conf.5 now:

http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=e978a8ffdda4e278b96e260a0a2ead8ca1c14e64
Comment 5 Zac Medico gentoo-dev 2010-08-28 03:58:15 UTC
This is fixed in 2.2_rc70.