[yum-git] 5 commits - test/depsolvetests.py yum/__init__.py yum/sqlitesack.py yum/yumRepo.py
James Antill
james at linux.duke.edu
Fri Apr 18 22:27:48 UTC 2008
test/depsolvetests.py | 35 +++++++++++++++++++++++++++++++++++
yum/__init__.py | 3 ++-
yum/sqlitesack.py | 5 ++++-
yum/yumRepo.py | 2 +-
4 files changed, 42 insertions(+), 3 deletions(-)
New commits:
commit 08d7a351d2c47abf45d061b0736d7d59dabada84
Author: James Antill <james at and.org>
Date: Fri Apr 18 18:27:41 2008 -0400
Die if we fail to download, leads to adding None dobj anyway
diff --git a/yum/yumRepo.py b/yum/yumRepo.py
index 0074d11..3815ced 100644
--- a/yum/yumRepo.py
+++ b/yum/yumRepo.py
@@ -154,7 +154,7 @@ class YumPackageSack(packageSack.PackageSack):
db_un_fn = self._check_uncompressed_db(repo, mydbtype)
if not db_un_fn:
- db_fn = repo._retrieveMD(mydbtype, retrieve_can_fail=True)
+ db_fn = repo._retrieveMD(mydbtype)
if db_fn:
db_un_fn = db_fn.replace('.bz2', '')
if not repo.cache:
commit 8b81325e5cacac0a522a280dc1f0b6c32c258c2a
Author: James Antill <james at and.org>
Date: Fri Apr 18 18:27:01 2008 -0400
Complain loudly if we try and add None, bug#442819 among others
diff --git a/yum/sqlitesack.py b/yum/sqlitesack.py
index 25bf162..d76a1a1 100644
--- a/yum/sqlitesack.py
+++ b/yum/sqlitesack.py
@@ -384,6 +384,9 @@ class YumSqlitePackageSack(yumRepo.YumPackageSack):
if not self.excludes.has_key(repo):
self.excludes[repo] = {}
+ if dataobj is None:
+ raise Errors.RepoError, "Tried to add None %s to %s" % (datatype, repo)
+
if datatype == 'metadata':
self.primarydb[repo] = dataobj
elif datatype == 'filelists':
@@ -392,7 +395,7 @@ class YumSqlitePackageSack(yumRepo.YumPackageSack):
self.otherdb[repo] = dataobj
else:
# We can not handle this yet...
- raise "Sorry sqlite does not support %s" % (datatype)
+ raise Errors.RepoError, "Sorry sqlite does not support %s in %s" % (datatype, repo)
self.added[repo].append(datatype)
commit 493075c758d7f158aad33531d06e49b9dc9bf78c
Author: James Antill <james at and.org>
Date: Fri Apr 18 18:26:34 2008 -0400
Don't do total size if we only have one thing to download
diff --git a/yum/__init__.py b/yum/__init__.py
index 6bde7b5..6b2945d 100644
--- a/yum/__init__.py
+++ b/yum/__init__.py
@@ -1075,7 +1075,8 @@ class YumBase(depsolve.Depsolve):
remote_pkgs.sort(mediasort)
# This is kind of a hack and does nothing in non-Fedora versions,
# we'll fix it one way or anther soon.
- if hasattr(urlgrabber.progress, 'text_meter_total_size'):
+ if (hasattr(urlgrabber.progress, 'text_meter_total_size') and
+ len(remote_pkgs) > 1):
urlgrabber.progress.text_meter_total_size(remote_size)
i = 0
for po in remote_pkgs:
commit caea617d1fe05097aecb26f7d2f635d4feb69716
Merge: eb29dae... e30cbf8...
Author: James Antill <james at and.org>
Date: Fri Apr 18 15:32:20 2008 -0400
Merge branch 'master' of ssh://login.linux.duke.edu/home/groups/yum/git/yum
* 'master' of ssh://login.linux.duke.edu/home/groups/yum/git/yum:
make errors raised for available and installed packages having incorrect attributes be the same
Updated de translation by Fabian Affolter
commit eb29dae46975df670022c47d6a7e8bf23004c3bf
Author: James Antill <james at and.org>
Date: Thu Apr 17 20:58:50 2008 -0400
Add unison test case
diff --git a/test/depsolvetests.py b/test/depsolvetests.py
index fd25836..3f8c748 100644
--- a/test/depsolvetests.py
+++ b/test/depsolvetests.py
@@ -872,3 +872,38 @@ class DepsolveTests(DepsolveTests):
# self.assertResult((xpo, po3))
# self.assertResult((xpo, po2))
self.assertResult((xpo, po2, po3))
+
+ # Test from "Real Life" because we just can't think like they do
+ def testRL_unison1(self):
+ xpo = FakePackage('abcd', version='2', arch='i386')
+ xpo.addRequires('unison', None, (None, None, None))
+ self.tsInfo.addInstall(xpo)
+
+ po1 = FakePackage('unison213', version='2.13.16', release='9')
+ po1.addProvides('unison', 'EQ', ('0', '2.13.16', '9'))
+ po1.addObsoletes('unison', 'LT', ('0', '2.27.57', '3'))
+ self.xsack.addPackage(po1)
+ po2 = FakePackage('unison227', version='2.27.57', release='7')
+ po2.addProvides('unison', 'EQ', ('0', '2.27.57', '7'))
+ po2.addObsoletes('unison', 'LT', ('0', '2.27.57', '3'))
+ self.xsack.addPackage(po2)
+
+ self.assertEquals('ok', *self.resolveCode())
+ self.assertResult((xpo, po2))
+
+ def testRL_unison2(self):
+ xpo = FakePackage('abcd', version='2', arch='i386')
+ xpo.addRequires('unison', None, (None, None, None))
+ self.tsInfo.addInstall(xpo)
+
+ po1 = FakePackage('unison213', version='2.13.16', release='9')
+ po1.addProvides('unison', 'EQ', ('0', '2.13.16', '9'))
+ po1.addObsoletes('unison', 'LT', ('0', '2.27.57', '3'))
+ po2 = FakePackage('unison227', version='2.27.57', release='7')
+ po2.addProvides('unison', 'EQ', ('0', '2.27.57', '7'))
+ po2.addObsoletes('unison', 'LT', ('0', '2.27.57', '3'))
+ self.xsack.addPackage(po2)
+ self.xsack.addPackage(po1)
+
+ self.assertEquals('ok', *self.resolveCode())
+ self.assertResult((xpo, po2))
More information about the Yum-cvs-commits
mailing list