* fix: delete package repo db from disk on removal
This commit is contained in:
@@ -93,6 +93,9 @@ class LockedDBShelf(shelve.DBShelf):
|
||||
raise Error(_('Cannot attain read or write access to database %s') % dbname)
|
||||
self.open(filename, dbname, filetype, flags, mode)
|
||||
|
||||
def destroy(self):
|
||||
os.unlink(self.filename)
|
||||
|
||||
def __del__(self):
|
||||
# superclass does something funky, we don't need that
|
||||
pass
|
||||
|
||||
+5
-1
@@ -44,6 +44,10 @@ class PackageDB(object):
|
||||
def close(self):
|
||||
self.d.close()
|
||||
self.dr.close()
|
||||
|
||||
def destroy(self):
|
||||
self.d.destroy()
|
||||
self.dr.destroy()
|
||||
|
||||
def has_package(self, name, txn = None):
|
||||
name = str(name)
|
||||
@@ -118,8 +122,8 @@ def get_db(name):
|
||||
|
||||
def remove_db(name):
|
||||
pisi.packagedb.packagedbs[name].close()
|
||||
pisi.packagedb.packagedbs[name].destroy()
|
||||
del pisi.packagedb.packagedbs[name]
|
||||
#FIXME: erase database file?
|
||||
|
||||
def has_package(name, txn = None):
|
||||
def proc(txn):
|
||||
|
||||
Reference in New Issue
Block a user