[yum-git] Branch 'yum-3_2_X' - 3 commits - test/depsolvetests.py yum/__init__.py
James Antill
james at linux.duke.edu
Wed Aug 6 02:25:47 UTC 2008
test/depsolvetests.py | 43 +++++++++++++++++++++++++++++++++++++++++++
yum/__init__.py | 9 ++++++---
2 files changed, 49 insertions(+), 3 deletions(-)
New commits:
commit 33abf35cee3d383bcf764d69402d940f70650005
Author: James Antill <james at and.org>
Date: Tue Aug 5 22:25:20 2008 -0400
Add failing test case for non-latest update/install with dep. -- update fails
diff --git a/test/depsolvetests.py b/test/depsolvetests.py
index ca80d97..e57148d 100644
--- a/test/depsolvetests.py
+++ b/test/depsolvetests.py
@@ -904,3 +904,46 @@ class DepsolveTests(DepsolveTests):
self.assertEquals('ok', *self.resolveCode())
self.assertResult((xpo, po2))
+
+ def test_min_inst_and_dep(self):
+ ipo1 = FakePackage('bar', version='2')
+ self.tsInfo.addInstall(ipo1)
+
+ ipo2 = FakePackage('foo')
+ ipo2.addRequires('bar', 'GE', (None, '3', '0'))
+ self.tsInfo.addInstall(ipo2)
+
+ po1 = FakePackage('foo')
+ self.xsack.addPackage(po1)
+ po2 = FakePackage('bar', version='2')
+ self.xsack.addPackage(po2)
+ po3 = FakePackage('bar', version='3')
+ self.xsack.addPackage(po3)
+ po4 = FakePackage('bar', version='4')
+ self.xsack.addPackage(po4)
+
+ self.assertEquals('ok', *self.resolveCode())
+ self.assertResult((ipo2, po4))
+
+ def test_min_up_and_dep(self):
+ rpo1 = FakePackage('bar', version='1')
+ self.rpmdb.addPackage(rpo1)
+
+ ipo1 = FakePackage('bar', version='2')
+ self.tsInfo.addUpdate(ipo1, oldpo=rpo1)
+
+ ipo2 = FakePackage('foo')
+ ipo2.addRequires('bar', 'GE', (None, '3', '0'))
+ self.tsInfo.addInstall(ipo2)
+
+ po1 = FakePackage('foo')
+ self.xsack.addPackage(po1)
+ po2 = FakePackage('bar', version='2')
+ self.xsack.addPackage(po2)
+ po3 = FakePackage('bar', version='3')
+ self.xsack.addPackage(po3)
+ po4 = FakePackage('bar', version='4')
+ self.xsack.addPackage(po4)
+
+ self.assertEquals('ok', *self.resolveCode())
+ self.assertResult((ipo2, po4))
commit 32a6a4f7fa1ff247c66cb8f48426af379c1f81c0
Author: James Antill <james at and.org>
Date: Tue Aug 5 22:06:36 2008 -0400
Don't display download count if 1 pkg to download
diff --git a/yum/__init__.py b/yum/__init__.py
index b514414..dc06d21 100644
--- a/yum/__init__.py
+++ b/yum/__init__.py
@@ -1114,8 +1114,11 @@ class YumBase(depsolve.Depsolve):
continue
try:
- text = '(%s/%s): %s' % (i, len(remote_pkgs),
- os.path.basename(po.relativepath))
+ if len(remote_pkgs) == 1:
+ text = os.path.basename(po.relativepath)
+ else:
+ text = '(%s/%s): %s' % (i, len(remote_pkgs),
+ os.path.basename(po.relativepath))
mylocal = po.repo.getPackage(po,
checkfunc=checkfunc,
text=text,
commit a1977225604932a92b673f4636133385a126a042
Author: James Antill <james at and.org>
Date: Tue Aug 5 22:05:02 2008 -0400
Don't display download total if <= 1 pkgs downloaded
diff --git a/yum/__init__.py b/yum/__init__.py
index b742566..b514414 100644
--- a/yum/__init__.py
+++ b/yum/__init__.py
@@ -1132,7 +1132,7 @@ class YumBase(depsolve.Depsolve):
if errors.has_key(po):
del errors[po]
- if hasattr(urlgrabber.progress, 'TerminalLine'):
+ if len(remote_pkgs) > 1 and hasattr(urlgrabber.progress,'TerminalLine'):
tl = urlgrabber.progress.TerminalLine(8)
print "-" * tl.rest()
dl_time = time.time() - beg_download
More information about the Yum-cvs-commits
mailing list