[yum-commits] 2 commits - cli.py yum/config.py yum/depsolve.py yum/__init__.py
James Antill
james at osuosl.org
Tue Oct 29 19:00:10 UTC 2013
cli.py | 2 +-
yum/__init__.py | 8 +++++++-
yum/config.py | 2 ++
yum/depsolve.py | 7 ++++++-
4 files changed, 16 insertions(+), 3 deletions(-)
New commits:
commit 4fa613c3e48be427d9a1ec677ba33aa207630b54
Author: James Antill <james at and.org>
Date: Tue Oct 29 14:58:01 2013 -0400
Add loop limit for depsolving. BZ 1017840.
diff --git a/yum/config.py b/yum/config.py
index 52e539d..17aa0ca 100644
--- a/yum/config.py
+++ b/yum/config.py
@@ -894,6 +894,8 @@ class YumConf(StartupConf):
"glob:/etc/yum/fssnap.d/*.conf",
parse_default=True)
+ depsolve_loop_limit = PositiveIntOption(100, names_of_0=["<forever>"])
+
_reposlist = []
def dump(self):
diff --git a/yum/depsolve.py b/yum/depsolve.py
index 7002205..8b438bb 100644
--- a/yum/depsolve.py
+++ b/yum/depsolve.py
@@ -869,7 +869,9 @@ class Depsolve(object):
if self.dsCallback: self.dsCallback.start()
- while True:
+ depsolve_loop_count = 0
+ while depsolve_loop_count < self.conf.depsolve_loop_limit:
+ depsolve_loop_count += 1
CheckDeps = True
@@ -920,6 +922,9 @@ class Depsolve(object):
break
+ if depsolve_loop_count >= self.conf.depsolve_loop_limit:
+ return (1, [_("Depsolving loop limit reached.")] + unique(errors))
+
# FIXME: this doesn't belong here at all...
for txmbr in self.tsInfo.getMembers():
if self.allowedMultipleInstalls(txmbr.po) and \
commit a39f13193419ce9494f21963b32ed7d4453e8e49
Author: James Antill <james at and.org>
Date: Fri Oct 25 16:38:13 2013 -0400
Fix some bugs in setopt for repo config. entries. BZ 1023595.
1. Sort the wildcard entries, so we always do them in the same order
(probably almost never get more than one anyway).
2. Split repoid.config_name on the last dot instead of the first as
repoid can contain dots.
3. Don't set non-wildcard entries twice, just for fun.
diff --git a/cli.py b/cli.py
index e679546..7f6643f 100755
--- a/cli.py
+++ b/cli.py
@@ -192,7 +192,7 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
bad_setopt_ne.append(item)
continue
k,v = vals
- period = k.find('.')
+ period = k.rfind('.')
if period != -1:
repo = k[:period]
k = k[period+1:]
diff --git a/yum/__init__.py b/yum/__init__.py
index 83d2efb..6a6f1fc 100644
--- a/yum/__init__.py
+++ b/yum/__init__.py
@@ -495,7 +495,13 @@ class YumBase(depsolve.Depsolve):
thisrepo.base_persistdir = self.conf._repos_persistdir
# do the wildcard ones first
- for i in self.repo_setopts:
+ # The keys are in indeterminate order at this point, *sigh*.
+ for i in sorted(self.repo_setopts):
+ # Skip normal names, as we want to do wildcard matches first
+ # and then override with specific id stuff.
+ if not misc.re_glob(i):
+ continue
+
if fnmatch.fnmatch(thisrepo.id, i):
for opt in self.repo_setopts[i].items:
if not hasattr(thisrepo, opt):
More information about the Yum-commits
mailing list