Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 796584 - >=sys-apps/portage-3.0.19: portage.sets.dbapi.OwnerSet exception if exclude-files not specified
Summary: >=sys-apps/portage-3.0.19: portage.sets.dbapi.OwnerSet exception if exclude-f...
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core (show other bugs)
Hardware: All Linux
: Normal minor (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords: InVCS, REGRESSION
Depends on:
Blocks: 785484
  Show dependency tree
 
Reported: 2021-06-18 09:45 UTC by Sascha Beck
Modified: 2021-08-28 10:09 UTC (History)
2 users (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 Sascha Beck 2021-06-18 09:45:20 UTC
After dependency calculation the following BT is generated:

Calculating dependencies... done!
Traceback (most recent call last):
  File "/usr/lib/python-exec/python3.9/emerge", line 51, in <module>
    retval = emerge_main()
  File "/usr/lib/python3.9/site-packages/_emerge/main.py", line 1319, in emerge_main
    return run_action(emerge_config)
  File "/usr/lib/python3.9/site-packages/_emerge/actions.py", line 3392, in run_action
    retval = action_build(emerge_config, spinner=spinner)
  File "/usr/lib/python3.9/site-packages/_emerge/actions.py", line 354, in action_build
    success, mydepgraph, favorites = backtrack_depgraph(
  File "/usr/lib/python3.9/site-packages/_emerge/depgraph.py", line 10005, in backtrack_depgraph
    return _backtrack_depgraph(settings, trees, myopts, myparams,
  File "/usr/lib/python3.9/site-packages/_emerge/depgraph.py", line 10043, in _backtrack_depgraph
    success, favorites = mydepgraph.select_files(myfiles)
  File "/usr/lib/python3.9/site-packages/_emerge/depgraph.py", line 4055, in select_files
    return self._select_files(args)
  File "/usr/lib/python3.9/site-packages/_emerge/depgraph.py", line 4189, in _select_files
    set_atoms = root_config.setconfig.getSetAtoms(s)
  File "/usr/lib/python3.9/site-packages/portage/_sets/__init__.py", line 271, in getSetAtoms
    myatoms.update(self.getSetAtoms(s,
  File "/usr/lib/python3.9/site-packages/portage/_sets/__init__.py", line 271, in getSetAtoms
    myatoms.update(self.getSetAtoms(s,
  File "/usr/lib/python3.9/site-packages/portage/_sets/__init__.py", line 260, in getSetAtoms
    myatoms = myset.getAtoms()
  File "/usr/lib/python3.9/site-packages/portage/_sets/base.py", line 58, in getAtoms
    self._load()
  File "/usr/lib/python3.9/site-packages/portage/_sets/base.py", line 53, in _load
    self.load()
  File "/usr/lib/python3.9/site-packages/portage/_sets/dbapi.py", line 111, in load
    self._setAtoms(self.mapPathsToAtoms(self._files,
  File "/usr/lib/python3.9/site-packages/portage/_sets/dbapi.py", line 83, in mapPathsToAtoms
    for p in exclude_paths:
TypeError: 'NoneType' object is not iterable

This is caused by not specifying excluded-files in a user set which uses portage.sets.dbapi.OwnerSet, which is not a required option, and also not documented in the only documentation I could find about the topic.
See: https://dev.gentoo.org/~zmedico/portage/doc/ch02s03s15.html


Reproducible: Always

Steps to Reproduce:
1. Configure /usr/portage/sets.conf with a set using OwnerSet without excluded-files option e.g.:

[kernels]
class = portage.sets.dbapi.OwnerSet
world-candidate = False
files = /usr/src

2. Run emerge -DuNatv world
Actual Results:  
See exception in description.

Expected Results:  
No exception and display of packages to be merged.

Looks like in portage/_sets/dbapi.py lines 82:86 belong into the else of the following if statement.

Workaround at the moment is defining excluded-files empty in the set.
Comment 1 Neil Bothwick 2021-06-18 13:51:12 UTC
Shouldn't that be exclude-files rather than excluded-files?
Comment 2 Sascha Beck 2021-06-18 13:56:11 UTC
Oops my bad you are right the option is named exclude-files, I had it right in the title.
Comment 3 Neil Bothwick 2021-06-18 14:01:43 UTC
This sort of change should have been preceded by a news item. At the very least, an ewarn message would have saved a lot of grief and time.
Comment 4 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-06-18 14:18:36 UTC
(In reply to Neil Bothwick from comment #3)
> This sort of change should have been preceded by a news item. At the very
> least, an ewarn message would have saved a lot of grief and time.

Well, I'm fairly sure it's a bug.
Comment 5 Larry the Git Cow gentoo-dev 2021-06-18 15:44:15 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/portage.git/commit/?id=38d3ff6abba53f664e52d0bfafff5ab49d052bb8

commit 38d3ff6abba53f664e52d0bfafff5ab49d052bb8
Author:     Zac Medico <zmedico@gentoo.org>
AuthorDate: 2021-06-18 15:36:51 +0000
Commit:     Zac Medico <zmedico@gentoo.org>
CommitDate: 2021-06-18 15:39:16 +0000

    OwnerSet: handle missing or empty exclude-files parameter (bug 796584)
    
    Fixes: f55156d167a6 ("lib/portage/_sets/dbapi.py: add glob support to exclude-files parameter cnf/sets/portage.conf: add exclude-files=/usr/src/linux* in module-rebuild set")
    Bug: https://bugs.gentoo.org/796584
    Signed-off-by: Zac Medico <zmedico@gentoo.org>

 lib/portage/_sets/dbapi.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Comment 6 Larry the Git Cow gentoo-dev 2021-06-18 15:53:06 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/portage.git/commit/?id=693f6bf5a54e2424e2ad49e1838b61f76bf78e40

commit 693f6bf5a54e2424e2ad49e1838b61f76bf78e40
Author:     Zac Medico <zmedico@gentoo.org>
AuthorDate: 2021-06-18 15:50:43 +0000
Commit:     Zac Medico <zmedico@gentoo.org>
CommitDate: 2021-06-18 15:51:58 +0000

    OwnerSet: fix inverted exclude_paths condition
    
    Bug: https://bugs.gentoo.org/796584
    Fixes: 38d3ff6abba5 ("OwnerSet: handle missing or empty exclude-files parameter (bug 796584)")
    Signed-off-by: Zac Medico <zmedico@gentoo.org>

 lib/portage/_sets/dbapi.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Comment 7 Larry the Git Cow gentoo-dev 2021-06-18 16:36:09 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=27d01762f36c119670ee8a8e7a570c1dc8a697d4

commit 27d01762f36c119670ee8a8e7a570c1dc8a697d4
Author:     Zac Medico <zmedico@gentoo.org>
AuthorDate: 2021-06-18 16:32:13 +0000
Commit:     Zac Medico <zmedico@gentoo.org>
CommitDate: 2021-06-18 16:35:02 +0000

    sys-apps/portage: 3.0.20-r4 regression fix revbump
    
     #796584 - OwnerSet exception if exclude-files not specified
    
    Bug: https://bugs.gentoo.org/785484
    Closes: https://bugs.gentoo.org/796584
    Package-Manager: Portage-3.0.20, Repoman-3.0.3
    Signed-off-by: Zac Medico <zmedico@gentoo.org>

 sys-apps/portage/Manifest                                           | 1 +
 .../portage/{portage-3.0.20-r3.ebuild => portage-3.0.20-r4.ebuild}  | 6 +++++-
 2 files changed, 6 insertions(+), 1 deletion(-)