From: Cameron Dale Date: Wed, 5 Mar 2008 23:06:44 +0000 (-0800) Subject: Merge branch 'documentation' into apt-dht X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=b36fa9c7f5ad4827c8de990fbfca1a379bb60e39;p=quix0rs-apt-p2p.git Merge branch 'documentation' into apt-dht --- b36fa9c7f5ad4827c8de990fbfca1a379bb60e39 diff --cc apt_dht/AptPackages.py index 1cd517a,45c035f..c784b8b --- a/apt_dht/AptPackages.py +++ b/apt_dht/AptPackages.py @@@ -162,9 -209,12 +209,11 @@@ class AptPackages 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] = {} diff --cc apt_dht/db.py index cdd86c5,f72b104..fd265f6 --- a/apt_dht/db.py +++ b/apt_dht/db.py @@@ -87,8 -126,9 +126,9 @@@ class DB 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