From b452c8e4e3aacb6274bb03091f9b0ecea1613900 Mon Sep 17 00:00:00 2001 From: Will Woods Date: Wed, 4 Feb 2009 16:54:54 -0500 Subject: Comments-as-documentation --- repofs.py | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) (limited to 'repofs.py') diff --git a/repofs.py b/repofs.py index e07d6bd..161260e 100755 --- a/repofs.py +++ b/repofs.py @@ -8,6 +8,19 @@ # Exports the contents of the repo(s) in a filesystem that looks like this: # $PACKAGE_UID/[package contents] # where $PACKAGE_UID is some unique package identifier (e.g. ENVRA in RPM) +# +# Known bugs: +# - SimpleYumRepo needs a way to reload metadata +# - SimpleYumRepo.filecache never shrinks +# - Stuff goes all to heck if you run multithreaded +# - Probably need some locking or something to keep threads from fighting +# over the filecache +# +# TODO: +# - Actually frickin' implement open() and read() +# - Test mem/disk use with actual repos and actual users +# - Rewrite unpack() to use rpm2cpio +# - Rewrite stupid log() method to use logging module import os import glob @@ -106,8 +119,11 @@ class SimpleYumRepo(object): pkgkey[nevra] = key return pkgkey - # Cache filelist data pulled from the database - # XXX: can we make FUSE cache this info instead? + # Cache filelist data pulled from the database. + # XXX: Can we make FUSE cache this info instead? + # XXX: Seriously this is going to expand forever and consume gobs of memory. + # XXX: Then again, "gobs" might turn out to be, like, several dozen MB + # (i.e. No Big Deal). Need more testing here! def files_for_package(self, packageuid): if packageuid not in self.filecache: self.filecache[packageuid] = self.files_for_package_from_db(packageuid) @@ -271,7 +287,7 @@ class Repofs(FuseRO): if f == path: if t == 'f': return FileStat() - elif t == 'd': + elif t == 'd': return DirStat() #raise OSError(errno.ENOENT, "No such file or directory") # SourceForge FUSE Python reference says to use this instead: -- cgit