Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 541754 - sys-apps/portage: emerge AttributeError: 'unicode' object has no attribute 'operation'
Summary: sys-apps/portage: emerge AttributeError: 'unicode' object has no attribute 'o...
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core - Interface (emerge) (show other bugs)
Hardware: All All
: Normal normal
Assignee: Portage team
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks: 484436
  Show dependency tree
 
Reported: 2015-03-01 03:12 UTC by Zac Medico
Modified: 2015-03-04 21:51 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 Zac Medico gentoo-dev 2015-03-01 03:12:45 UTC
Traceback (most recent call last):
  File "/usr/lib/python-exec/python2.7/emerge", line 50, in <module>
    retval = emerge_main()
  File "/usr/lib64/python2.7/site-packages/_emerge/main.py", line 1070, in emerge_main
    return run_action(emerge_config)
  File "/usr/lib64/python2.7/site-packages/_emerge/actions.py", line 4082, in run_action
    emerge_config.args, spinner)
  File "/usr/lib64/python2.7/site-packages/_emerge/actions.py", line 320, in action_build
    settings, trees, myopts, myparams, myaction, myfiles, spinner)
  File "/usr/lib64/python2.7/site-packages/_emerge/depgraph.py", line 8640, in backtrack_depgraph
    myaction, myfiles, spinner)
  File "/usr/lib64/python2.7/site-packages/_emerge/depgraph.py", line 8672, in _backtrack_depgraph
    success, favorites = mydepgraph.select_files(myfiles)
  File "/usr/lib64/python2.7/site-packages/_emerge/depgraph.py", line 3309, in select_files
    return self._select_files(args)
  File "/usr/lib64/python2.7/site-packages/_emerge/depgraph.py", line 3645, in _select_files
    return self._resolve(myfavorites)
  File "/usr/lib64/python2.7/site-packages/_emerge/depgraph.py", line 3800, in _resolve
    self.altlist()
  File "/usr/lib64/python2.7/site-packages/_emerge/depgraph.py", line 6450, in altlist
    self._resolve_conflicts()
  File "/usr/lib64/python2.7/site-packages/_emerge/depgraph.py", line 6582, in _resolve_conflicts
    if not self._validate_blockers():
  File "/usr/lib64/python2.7/site-packages/_emerge/depgraph.py", line 6220, in _validate_blockers
    replacement_pkg in replacement_pkgs):
  File "/usr/lib64/python2.7/site-packages/_emerge/depgraph.py", line 6220, in <genexpr>
    replacement_pkg in replacement_pkgs):
AttributeError: 'unicode' object has no attribute 'operation'

This error is only triggered by invalid dependencies in /var/db/pkg, and the faulty code originates from this commit:

https://github.com/gentoo/portage/commit/4f5e4f697e2593df164fc9864893768f7d2375fc

The fix:

--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -6595,7 +6595,7 @@ class depgraph(object):
	if not success:
			replacement_pkgs = self._dynamic_config._package_tracker.match(
					myroot, pkg.slot_atom)
-           if any(replacement_pkg[0].operation == "merge" for \
+           if any(replacement_pkg.operation == "merge" for
		replacement_pkg in replacement_pkgs):
		# This package is being replaced anyway, so
		# ignore invalid dependencies so as not to
Comment 1 Zac Medico gentoo-dev 2015-03-01 03:25:51 UTC
There's a patch in the following branch:

	https://github.com/zmedico/portage/tree/bug_541754

I've posted it for review here:

	http://thread.gmane.org/gmane.linux.gentoo.portage.devel/5294
Comment 2 Zac Medico gentoo-dev 2015-03-03 21:29:46 UTC
This is in the master branch now:

https://github.com/gentoo/portage/commit/27eecce94b4e897f13d9f4bae129db37368895c9
Comment 3 Brian Dolbec (RETIRED) gentoo-dev 2015-03-04 21:51:14 UTC
Released in portage-2.2.18