diff options
author | Zac Medico <zmedico@gentoo.org> | 2019-01-19 00:39:47 -0800 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2019-01-20 14:57:28 -0800 |
commit | eb2674c1c2d84b2c9e9923e1c1666cb7a596c36c (patch) | |
tree | b85724e26e35def7b6f50a5cac9818f56d22fec6 /lib/portage/tests/util | |
parent | ResolverPlayground: add chgrp to essential_binaries (diff) | |
download | portage-eb2674c1c2d84b2c9e9923e1c1666cb7a596c36c.tar.gz portage-eb2674c1c2d84b2c9e9923e1c1666cb7a596c36c.tar.bz2 portage-eb2674c1c2d84b2c9e9923e1c1666cb7a596c36c.zip |
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/']}}}
Bug: https://bugs.gentoo.org/675826
Signed-off-by: Zac Medico <zmedico@gentoo.org>
Diffstat (limited to 'lib/portage/tests/util')
-rw-r--r-- | lib/portage/tests/util/test_install_mask.py | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/lib/portage/tests/util/test_install_mask.py b/lib/portage/tests/util/test_install_mask.py index f651eb4b7..6a29db79a 100644 --- a/lib/portage/tests/util/test_install_mask.py +++ b/lib/portage/tests/util/test_install_mask.py @@ -119,6 +119,42 @@ class InstallMaskTestCase(TestCase): ), ) ), + ( + '/usr/share/locale ' + '-/usr/share/locale/en* ' + '-/usr/share/locale/kf5_all_languages ' + '-/usr/share/locale/locale.alias', + ( + ( + 'usr/share/locale/en', + False, + ), + ( + 'usr/share/locale/en_GB', + False, + ), + ( + 'usr/share/locale/en/kf5_all_languages', + False, + ), + ( + 'usr/share/locale/locale.alias', + False, + ), + ( + 'usr/share/locale/es', + True, + ), + ( + 'usr/share/locale/fr', + True, + ), + ( + 'usr/share/locale', + True, + ), + ) + ), ) for install_mask_str, paths in cases: |