summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWill Woods <wwoods@redhat.com>2009-02-04 16:54:54 -0500
committerWill Woods <wwoods@redhat.com>2009-02-04 16:54:54 -0500
commitb452c8e4e3aacb6274bb03091f9b0ecea1613900 (patch)
treeb3bd7809e434368245321e8356569c33866a2f65
parent312d5db28740483224b0a87c335cc64cd4e58769 (diff)
downloaddebuginfofs-b452c8e4e3aacb6274bb03091f9b0ecea1613900.tar.gz
debuginfofs-b452c8e4e3aacb6274bb03091f9b0ecea1613900.tar.xz
debuginfofs-b452c8e4e3aacb6274bb03091f9b0ecea1613900.zip
Comments-as-documentation
-rwxr-xr-xrepofs.py22
1 files changed, 19 insertions, 3 deletions
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: