Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 675826

Summary: sys-apps/portage: optimize INSTALL_MASK match with and index and minimize fnmatch calls
Product: Portage Development Reporter: Zac Medico <zmedico>
Component: Core - ConfigurationAssignee: Portage team <dev-portage>
Severity: normal Keywords: InVCS
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: All   
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 671498    

Description Zac Medico gentoo-dev 2019-01-19 06:37:15 UTC
INSTALL_MASK patterns that are anchored by a leading / can be indexed in a tree structure, allowing the number of fnmatch calls to be minimized.
Comment 2 Larry the Git Cow gentoo-dev 2019-01-20 23:31:07 UTC
The bug has been referenced in the following commit(s):

commit eb2674c1c2d84b2c9e9923e1c1666cb7a596c36c
Author:     Zac Medico <>
AuthorDate: 2019-01-19 08:39:47 +0000
Commit:     Zac Medico <>
CommitDate: 2019-01-20 22:57:28 +0000

    INSTALL_MASK: index patterns anchored with leading slash (bug 675826)
    For scalability, use a tree structure to index patterns that are
    anchored with a leading slash.
    Patterns anchored with leading slash are indexed by leading non-glob
    components, making it possible to minimize the number of fnmatch
    calls. For example:
      /foo*/bar -> {'.': ['/foo*/bar']}
      /foo/bar* -> {'foo': {'.': ['/foo/bar*']}}
      /foo/bar/ -> {'foo': {'bar': {'.': ['/foo/bar/']}}}
    Signed-off-by: Zac Medico <>

 lib/portage/tests/util/ | 36 +++++++++++++
 lib/portage/util/            | 84 ++++++++++++++++++++++++++---
 2 files changed, 113 insertions(+), 7 deletions(-)
Comment 3 Larry the Git Cow gentoo-dev 2019-01-21 00:11:37 UTC
The bug has been referenced in the following commit(s):

commit 7d999af4a47bf55e53e54713d98d145f935935c1
Author:     Zac Medico <>
AuthorDate: 2019-01-21 00:01:42 +0000
Commit:     Zac Medico <>
CommitDate: 2019-01-21 00:08:55 +0000

    sys-apps/portage: version bump to 2.3.57
     #675756 emerge: compare new SLOT USE to installed SLOT
     #675826 INSTALL_MASK scalability: minimize fnmatch calls
     #675828 pid-sandbox: fix child process signal disposition
    Package-Manager: Portage-2.3.57, Repoman-2.3.12
    Signed-off-by: Zac Medico <>

 sys-apps/portage/Manifest              |   1 +
 sys-apps/portage/portage-2.3.57.ebuild | 271 +++++++++++++++++++++++++++++++++
 2 files changed, 272 insertions(+)
Comment 4 Zac Medico gentoo-dev 2019-04-10 04:29:10 UTC
Fixed in portage-2.3.62.