public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/portage:master commit in: lib/portage/_sets/, cnf/sets/
@ 2019-09-12  2:28 Zac Medico
  0 siblings, 0 replies; 2+ messages in thread
From: Zac Medico @ 2019-09-12  2:28 UTC (permalink / raw
  To: gentoo-commits

commit:     b1342ac2c83b4a1b0415eb5fcc4dd1d6c65561d8
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Sep 11 01:52:35 2019 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Sep 12 01:53:13 2019 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=b1342ac2

x11-module-rebuild: support SYMLINK_LIB=no (bug 693980)

Use a lib* glob to support SYMLINK_LIB=no.

Bug: https://bugs.gentoo.org/693980
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 cnf/sets/portage.conf         |  2 +-
 lib/portage/_sets/__init__.py |  2 +-
 lib/portage/_sets/dbapi.py    | 15 ++++++++++++---
 3 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/cnf/sets/portage.conf b/cnf/sets/portage.conf
index 38c50a647..0d11d7891 100644
--- a/cnf/sets/portage.conf
+++ b/cnf/sets/portage.conf
@@ -76,7 +76,7 @@ files = /lib/modules
 # excluding the package that owns /usr/bin/Xorg.
 [x11-module-rebuild]
 class = portage.sets.dbapi.OwnerSet
-files = /usr/lib/xorg/modules
+files = /usr/lib*/xorg/modules
 exclude-files = /usr/bin/Xorg
 
 # Binary packages that have a different build time from a currently

diff --git a/lib/portage/_sets/__init__.py b/lib/portage/_sets/__init__.py
index 7b81c55e2..a569b273b 100644
--- a/lib/portage/_sets/__init__.py
+++ b/lib/portage/_sets/__init__.py
@@ -142,7 +142,7 @@ class SetConfig(object):
 		parser.remove_section("x11-module-rebuild")
 		parser.add_section("x11-module-rebuild")
 		parser.set("x11-module-rebuild", "class", "portage.sets.dbapi.OwnerSet")
-		parser.set("x11-module-rebuild", "files", "/usr/lib/xorg/modules")
+		parser.set("x11-module-rebuild", "files", "/usr/lib*/xorg/modules")
 		parser.set("x11-module-rebuild", "exclude-files", "/usr/bin/Xorg")
 
 	def update(self, setname, options):

diff --git a/lib/portage/_sets/dbapi.py b/lib/portage/_sets/dbapi.py
index 5d78fd1d3..5c600ec9e 100644
--- a/lib/portage/_sets/dbapi.py
+++ b/lib/portage/_sets/dbapi.py
@@ -1,8 +1,9 @@
-# Copyright 2007-2014 Gentoo Foundation
+# Copyright 2007-2019 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 from __future__ import division
 
+import glob
 import re
 import time
 
@@ -67,11 +68,19 @@ class OwnerSet(PackageSet):
 
 	def mapPathsToAtoms(self, paths, exclude_paths=None):
 		"""
-		All paths must begin with a slash, must include EPREFIX, and
-		must not include ROOT.
+		All paths must begin with a slash, and must not include EROOT.
+		Supports globs.
 		"""
 		rValue = set()
 		vardb = self._db
+
+		eroot = vardb.settings['EROOT']
+		expanded_paths = []
+		for p in paths:
+			expanded_paths.extend(expanded_p[len(eroot)-1:] for expanded_p in
+				glob.iglob(os.path.join(eroot, p.lstrip(os.sep))))
+		paths = expanded_paths
+
 		pkg_str = vardb._pkg_str
 		if exclude_paths is None:
 			for link, p in vardb._owners.iter_owners(paths):


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [gentoo-commits] proj/portage:master commit in: lib/portage/_sets/, cnf/sets/
@ 2021-05-24  6:40 Zac Medico
  0 siblings, 0 replies; 2+ messages in thread
From: Zac Medico @ 2021-05-24  6:40 UTC (permalink / raw
  To: gentoo-commits

commit:     f55156d167a651229518b226e1e064fee47b73a2
Author:     Dave Hughes <davidhughes205 <AT> gmail <DOT> com>
AuthorDate: Fri Apr  9 00:59:07 2021 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon May 24 06:38:57 2021 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=f55156d1

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

Closes: https://github.com/gentoo/portage/pull/694
Signed-off-by: Dave Hughes <davidhughes205 <AT> gmail.com>
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 cnf/sets/portage.conf      | 1 +
 lib/portage/_sets/dbapi.py | 6 ++++++
 2 files changed, 7 insertions(+)

diff --git a/cnf/sets/portage.conf b/cnf/sets/portage.conf
index 5651a9c53..c4ad2efca 100644
--- a/cnf/sets/portage.conf
+++ b/cnf/sets/portage.conf
@@ -71,6 +71,7 @@ includes = bzr cvs darcs git-2 git-r3 golang-vcs mercurial subversion
 [module-rebuild]
 class = portage.sets.dbapi.OwnerSet
 files = /lib/modules
+exclude-files = /usr/src/linux*
 
 # Installed packages that own files inside /usr/lib/xorg/modules,
 # excluding the package that owns /usr/bin/Xorg.

diff --git a/lib/portage/_sets/dbapi.py b/lib/portage/_sets/dbapi.py
index 7a20553b5..17776f94c 100644
--- a/lib/portage/_sets/dbapi.py
+++ b/lib/portage/_sets/dbapi.py
@@ -79,6 +79,12 @@ class OwnerSet(PackageSet):
 				glob.iglob(os.path.join(eroot, p.lstrip(os.sep))))
 		paths = expanded_paths
 
+		expanded_exclude_paths = []
+		for p in exclude_paths:
+			expanded_exclude_paths.extend(expanded_exc_p[len(eroot)-1:] for expanded_exc_p in
+				glob.iglob(os.path.join(eroot, p.lstrip(os.sep))))
+		exclude_paths = expanded_exclude_paths
+
 		pkg_str = vardb._pkg_str
 		if exclude_paths is None:
 			for link, p in vardb._owners.iter_owners(paths):


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-05-24  6:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-09-12  2:28 [gentoo-commits] proj/portage:master commit in: lib/portage/_sets/, cnf/sets/ Zac Medico
  -- strict thread matches above, loose matches on Subject: below --
2021-05-24  6:40 Zac Medico

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox