[yum-commits] Branch 'yum-3_2_X' - yum/packages.py
Tim Lauridsen
timlau at osuosl.org
Fri Mar 13 13:50:18 UTC 2009
yum/packages.py | 10 ++++++++++
1 file changed, 10 insertions(+)
New commits:
commit 4a0286274f0b87fdcb0fe4b6739abd10f8ced471
Author: Tim Lauridsen <tim at naboo.local>
Date: Fri Mar 13 14:46:24 2009 +0100
Add a FakeSack to FakeRepository
diff --git a/yum/packages.py b/yum/packages.py
index 5fd07a7..a7e81e6 100644
--- a/yum/packages.py
+++ b/yum/packages.py
@@ -153,10 +153,20 @@ def parsePackages(pkgs, usercommands, casematch=0,
raise ValueError, "Bad value for unique: %s" % unique
return exactmatch, matched, unmatched
+class FakeSack:
+ """ Fake PackageSack to use with FakeRepository"""
+ def __init__(self):
+ pass # This is fake, so do nothing
+
+ def delPackage(self, obj):
+ """delete a pkgobject, do nothing, but make localpackages work with --skip-broken"""
+ pass # This is fake, so do nothing
+
class FakeRepository:
"""Fake repository class for use in rpmsack package objects"""
def __init__(self, repoid):
self.id = repoid
+ self.sack = FakeSack()
def __cmp__(self, other):
if self.id > other.id:
More information about the Yum-commits
mailing list