1 |
Signed-off-by: Aaron Bauman <bman@g.o> |
2 |
--- |
3 |
lib/portage/_sets/dbapi.py | 28 ++++++++++++++-------------- |
4 |
1 file changed, 14 insertions(+), 14 deletions(-) |
5 |
|
6 |
diff --git a/lib/portage/_sets/dbapi.py b/lib/portage/_sets/dbapi.py |
7 |
index a9e1b6880..15d1c3786 100644 |
8 |
--- a/lib/portage/_sets/dbapi.py |
9 |
+++ b/lib/portage/_sets/dbapi.py |
10 |
@@ -1,4 +1,4 @@ |
11 |
-# Copyright 2007-2019 Gentoo Authors |
12 |
+# Copyright 2007-2020 Gentoo Authors |
13 |
# Distributed under the terms of the GNU General Public License v2 |
14 |
|
15 |
from __future__ import division |
16 |
@@ -48,7 +48,7 @@ class EverythingSet(PackageSet): |
17 |
myatoms.append(atom) |
18 |
|
19 |
self._setAtoms(myatoms) |
20 |
- |
21 |
+ |
22 |
def singleBuilder(self, options, settings, trees): |
23 |
return EverythingSet(trees["vartree"].dbapi) |
24 |
singleBuilder = classmethod(singleBuilder) |
25 |
@@ -156,7 +156,7 @@ class VariableSet(EverythingSet): |
26 |
|
27 |
if not (includes or excludes): |
28 |
raise SetConfigError(_("no includes or excludes given")) |
29 |
- |
30 |
+ |
31 |
metadatadb = options.get("metadata-source", "vartree") |
32 |
if not metadatadb in trees: |
33 |
raise SetConfigError(_("invalid value '%s' for option metadata-source") % metadatadb) |
34 |
@@ -266,7 +266,7 @@ class UnavailableBinaries(EverythingSet): |
35 |
|
36 |
class CategorySet(PackageSet): |
37 |
_operations = ["merge", "unmerge"] |
38 |
- |
39 |
+ |
40 |
def __init__(self, category, dbapi, only_visible=True): |
41 |
super(CategorySet, self).__init__() |
42 |
self._db = dbapi |
43 |
@@ -277,7 +277,7 @@ class CategorySet(PackageSet): |
44 |
else: |
45 |
s="all" |
46 |
self.description = "Package set containing %s packages of category %s" % (s, self._category) |
47 |
- |
48 |
+ |
49 |
def load(self): |
50 |
myatoms = [] |
51 |
for cp in self._db.cp_all(): |
52 |
@@ -285,7 +285,7 @@ class CategorySet(PackageSet): |
53 |
if (not self._check) or len(self._db.match(cp)) > 0: |
54 |
myatoms.append(cp) |
55 |
self._setAtoms(myatoms) |
56 |
- |
57 |
+ |
58 |
def _builderGetRepository(cls, options, repositories): |
59 |
repository = options.get("repository", "porttree") |
60 |
if not repository in repositories: |
61 |
@@ -296,7 +296,7 @@ class CategorySet(PackageSet): |
62 |
def _builderGetVisible(cls, options): |
63 |
return get_boolean(options, "only_visible", True) |
64 |
_builderGetVisible = classmethod(_builderGetVisible) |
65 |
- |
66 |
+ |
67 |
def singleBuilder(cls, options, settings, trees): |
68 |
if not "category" in options: |
69 |
raise SetConfigError(_("no category given")) |
70 |
@@ -307,13 +307,13 @@ class CategorySet(PackageSet): |
71 |
|
72 |
repository = cls._builderGetRepository(options, trees.keys()) |
73 |
visible = cls._builderGetVisible(options) |
74 |
- |
75 |
+ |
76 |
return CategorySet(category, dbapi=trees[repository].dbapi, only_visible=visible) |
77 |
singleBuilder = classmethod(singleBuilder) |
78 |
|
79 |
def multiBuilder(cls, options, settings, trees): |
80 |
rValue = {} |
81 |
- |
82 |
+ |
83 |
if "categories" in options: |
84 |
categories = options["categories"].split() |
85 |
invalid = set(categories).difference(settings.categories) |
86 |
@@ -321,14 +321,14 @@ class CategorySet(PackageSet): |
87 |
raise SetConfigError(_("invalid categories: %s") % ", ".join(list(invalid))) |
88 |
else: |
89 |
categories = settings.categories |
90 |
- |
91 |
+ |
92 |
repository = cls._builderGetRepository(options, trees.keys()) |
93 |
visible = cls._builderGetVisible(options) |
94 |
name_pattern = options.get("name_pattern", "$category/*") |
95 |
- |
96 |
+ |
97 |
if not "$category" in name_pattern and not "${category}" in name_pattern: |
98 |
raise SetConfigError(_("name_pattern doesn't include $category placeholder")) |
99 |
- |
100 |
+ |
101 |
for cat in categories: |
102 |
myset = CategorySet(cat, trees[repository].dbapi, only_visible=visible) |
103 |
myname = name_pattern.replace("$category", cat) |
104 |
@@ -347,7 +347,7 @@ class AgeSet(EverythingSet): |
105 |
self._age = age |
106 |
|
107 |
def _filter(self, atom): |
108 |
- |
109 |
+ |
110 |
cpv = self._db.match(atom)[0] |
111 |
try: |
112 |
date, = self._db.aux_get(cpv, self._aux_keys) |
113 |
@@ -359,7 +359,7 @@ class AgeSet(EverythingSet): |
114 |
or (self._mode == "newer" and age >= self._age)): |
115 |
return False |
116 |
return True |
117 |
- |
118 |
+ |
119 |
def singleBuilder(cls, options, settings, trees): |
120 |
mode = options.get("mode", "older") |
121 |
if str(mode).lower() not in ["newer", "older"]: |
122 |
-- |
123 |
2.28.0 |