1 |
Use a lib* glob to support SYMLINK_LIB=no. |
2 |
|
3 |
Bug: https://bugs.gentoo.org/693980 |
4 |
Signed-off-by: Zac Medico <zmedico@g.o> |
5 |
--- |
6 |
cnf/sets/portage.conf | 2 +- |
7 |
lib/portage/_sets/__init__.py | 2 +- |
8 |
lib/portage/_sets/dbapi.py | 15 ++++++++++++--- |
9 |
3 files changed, 14 insertions(+), 5 deletions(-) |
10 |
|
11 |
diff --git a/cnf/sets/portage.conf b/cnf/sets/portage.conf |
12 |
index 38c50a647..0d11d7891 100644 |
13 |
--- a/cnf/sets/portage.conf |
14 |
+++ b/cnf/sets/portage.conf |
15 |
@@ -76,7 +76,7 @@ files = /lib/modules |
16 |
# excluding the package that owns /usr/bin/Xorg. |
17 |
[x11-module-rebuild] |
18 |
class = portage.sets.dbapi.OwnerSet |
19 |
-files = /usr/lib/xorg/modules |
20 |
+files = /usr/lib*/xorg/modules |
21 |
exclude-files = /usr/bin/Xorg |
22 |
|
23 |
# Binary packages that have a different build time from a currently |
24 |
diff --git a/lib/portage/_sets/__init__.py b/lib/portage/_sets/__init__.py |
25 |
index 7b81c55e2..a569b273b 100644 |
26 |
--- a/lib/portage/_sets/__init__.py |
27 |
+++ b/lib/portage/_sets/__init__.py |
28 |
@@ -142,7 +142,7 @@ class SetConfig(object): |
29 |
parser.remove_section("x11-module-rebuild") |
30 |
parser.add_section("x11-module-rebuild") |
31 |
parser.set("x11-module-rebuild", "class", "portage.sets.dbapi.OwnerSet") |
32 |
- parser.set("x11-module-rebuild", "files", "/usr/lib/xorg/modules") |
33 |
+ parser.set("x11-module-rebuild", "files", "/usr/lib*/xorg/modules") |
34 |
parser.set("x11-module-rebuild", "exclude-files", "/usr/bin/Xorg") |
35 |
|
36 |
def update(self, setname, options): |
37 |
diff --git a/lib/portage/_sets/dbapi.py b/lib/portage/_sets/dbapi.py |
38 |
index 5d78fd1d3..5c600ec9e 100644 |
39 |
--- a/lib/portage/_sets/dbapi.py |
40 |
+++ b/lib/portage/_sets/dbapi.py |
41 |
@@ -1,8 +1,9 @@ |
42 |
-# Copyright 2007-2014 Gentoo Foundation |
43 |
+# Copyright 2007-2019 Gentoo Authors |
44 |
# Distributed under the terms of the GNU General Public License v2 |
45 |
|
46 |
from __future__ import division |
47 |
|
48 |
+import glob |
49 |
import re |
50 |
import time |
51 |
|
52 |
@@ -67,11 +68,19 @@ class OwnerSet(PackageSet): |
53 |
|
54 |
def mapPathsToAtoms(self, paths, exclude_paths=None): |
55 |
""" |
56 |
- All paths must begin with a slash, must include EPREFIX, and |
57 |
- must not include ROOT. |
58 |
+ All paths must begin with a slash, and must not include EROOT. |
59 |
+ Supports globs. |
60 |
""" |
61 |
rValue = set() |
62 |
vardb = self._db |
63 |
+ |
64 |
+ eroot = vardb.settings['EROOT'] |
65 |
+ expanded_paths = [] |
66 |
+ for p in paths: |
67 |
+ expanded_paths.extend(expanded_p[len(eroot)-1:] for expanded_p in |
68 |
+ glob.iglob(os.path.join(eroot, p.lstrip(os.sep)))) |
69 |
+ paths = expanded_paths |
70 |
+ |
71 |
pkg_str = vardb._pkg_str |
72 |
if exclude_paths is None: |
73 |
for link, p in vardb._owners.iter_owners(paths): |
74 |
-- |
75 |
2.21.0 |