[Yum-devel] Accumulated patches, time to drop or add? [3/4]
James Antill
james.antill at redhat.com
Tue Jul 22 16:50:07 UTC 2008
I have 4 branches which might be worth putting in for 3.2.18, everyone
may or maynot have looked at them before and they aren't "obviously
simple/wonderful" enough I've just committed them, so I'll just list
them and you can tell me what you think...
_quickWhatProvides
group_pc
* repo-sacks
repomd-checksums
repo-sacks
This is fairly simple, it just delays creation of sacks from repos.
until they are used. Which basically means that repos. which aren't
enabled don't have sacks created in most cases.
I can't remember why I haven't just committed this, but I figure might
as well ask as I've left it until now :).
-------------- next part --------------
commit 6a344d1b1f99e0eb8789c087759feaa3f3f1c696
Merge: 7550b27... c50a61a...
Author: James Antill <james at and.org>
Date: Tue Jul 22 12:16:26 2008 -0400
Merge conflict
diff --cc yum/yumRepo.py
index 47ef8f1,b032b57..7723534
--- a/yum/yumRepo.py
+++ b/yum/yumRepo.py
@@@ -251,21 -251,19 +251,26 @@@ class YumRepository(Repository, config.
# callback function for handling media
self.mediafunc = None
+ self._sack = None
+
+ self._grabfunc = None
+ self._grab = None
+
+ def _getSack(self):
+ # FIXME: Note that having the repo hold the sack, which holds "repos"
+ # is not only confusing but creates a circular dep.
+ # Atm. we don't leak memory because RepoStorage.close() is called,
+ # which calls repo.close() which calls sack.close() which removes the
+ # repos from the sack ... thus. breaking the cycle.
- self.sack = sqlitesack.YumSqlitePackageSack(
+ if self._sack is None:
+ self._sack = sqlitesack.YumSqlitePackageSack(
sqlitesack.YumAvailablePackageSqlite)
-
- self._grabfunc = None
- self._grab = None
+ return self._sack
+ sack = property(_getSack)
def close(self):
- self.sack.close()
+ if self._sack is not None:
+ self.sack.close()
Repository.close(self)
def _resetSack(self):
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.baseurl.org/pipermail/yum-devel/attachments/20080722/dd9809dd/attachment.pgp
More information about the Yum-devel
mailing list