def __del__(self):
self.cleanup()
- self.packages.close()
def addRelease(self, cache_path, file_path):
- """Dirty hack until python-apt supports apt-pkg/indexrecords.h
+ """Add a Release file's info to the list of index files.
+
+ Dirty hack until python-apt supports apt-pkg/indexrecords.h
(see Bug #456141)
"""
self.indexrecords[cache_path] = {}
new_hash = False
hashID = row['hashID']
else:
+ # Add the new hash to the database
c = self.conn.cursor()
- c.execute("INSERT OR REPLACE INTO hashes (hash, pieces, piecehash, refreshed) VALUES (?, ?, ?)",
+ c.execute("INSERT OR REPLACE INTO hashes (hash, pieces, piecehash, refreshed) VALUES (?, ?, ?, ?)",
(khash(hash), khash(pieces), khash(piecehash), datetime.now()))
self.conn.commit()
new_hash = True