[yum-commits] 2 commits - yum/sqlitesack.py yum/yumRepo.py
James Antill
james at osuosl.org
Thu Sep 6 17:53:31 UTC 2012
yum/sqlitesack.py | 4 ++--
yum/yumRepo.py | 16 ++++++++++++++--
2 files changed, 16 insertions(+), 4 deletions(-)
New commits:
commit 21de20de22ff70c04bc82715e8cb4c37d1a79633
Author: James Antill <james at and.org>
Date: Thu Sep 6 13:52:05 2012 -0400
Don't quick fail for excludes that start with [foo] lists.
diff --git a/yum/sqlitesack.py b/yum/sqlitesack.py
index ba929de..ed57408 100644
--- a/yum/sqlitesack.py
+++ b/yum/sqlitesack.py
@@ -69,7 +69,7 @@ def _parse_pkg_n(match, regexp_match, n):
if not regexp_match:
return False
- if (match and n and match[0] not in ('?', '*') and match[0] != n[0]):
+ if (match and n and match[0] not in ('?', '*', '[') and match[0] != n[0]):
return False
if regexp_match(n):
return True
@@ -82,7 +82,7 @@ def _parse_pkg(match, regexp_match, data, e,v,r,a):
# Worthless speed hacks?
if match == n:
return True
- if (match and n and match[0] not in ('?', '*') and
+ if (match and n and match[0] not in ('?', '*', '[') and
match[0] != n[0] and match[0] != e[0]):
return False
commit 87dc9dab0b1968aedb2ca9bfe6b5b20b397dcbbc
Author: James Antill <james at and.org>
Date: Fri Aug 31 15:57:55 2012 -0400
Do the same no statvfs check when using relative paths.
diff --git a/yum/yumRepo.py b/yum/yumRepo.py
index 7f1f1db..876dc12 100644
--- a/yum/yumRepo.py
+++ b/yum/yumRepo.py
@@ -844,6 +844,19 @@ class YumRepository(Repository, config.RepoConf):
value),
fdel=lambda self: setattr(self, "_metalink", None))
+ def _all_urls_are_files(self, url):
+ if url:
+ return url.startswith("/") or url.startswith("file:")
+
+ if not self.urls: # WTF ... but whatever.
+ return False
+
+ # Not an explicit url ... so make sure all mirrors/etc. are file://
+ for url in self.urls:
+ if not self._all_urls_are_files(url):
+ return False
+ return True
+
def _getFile(self, url=None, relative=None, local=None, start=None, end=None,
copy_local=None, checkfunc=None, text=None, reget='simple',
cache=True, size=None, **kwargs):
@@ -891,8 +904,7 @@ class YumRepository(Repository, config.RepoConf):
except Errors.MediaError, e:
verbose_logger.log(logginglevels.DEBUG_2, "Error getting package from media; falling back to url %s" %(e,))
- if size and (copy_local or not url or
- not (url.startswith("/") or url.startswith("file:"))):
+ if size and (copy_local or not self._all_urls_are_files(url)):
dirstat = os.statvfs(os.path.dirname(local))
avail = dirstat.f_bavail * dirstat.f_bsize
if avail < long(size):
More information about the Yum-commits
mailing list