From e333806ae0a2b7099c3be6179c4ac65abe0e2896 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Wed, 23 May 2007 00:37:01 +0000 Subject: Store the path of $PKGDIR/Packages as binarytree._pkgindex_file. svn path=/main/trunk/; revision=6588 --- pym/portage/dbapi/bintree.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pym/portage/dbapi/bintree.py b/pym/portage/dbapi/bintree.py index 59fe9a5db..d74b4a8c5 100644 --- a/pym/portage/dbapi/bintree.py +++ b/pym/portage/dbapi/bintree.py @@ -115,6 +115,7 @@ class binarytree(object): self._pkg_paths = {} self._all_directory = os.path.isdir( os.path.join(self.pkgdir, "All")) + self._pkgindex_file = os.path.join(self.pkgdir, "Packages") self._pkgindex = None self._pkgindex_keys = set(["CPV", "SLOT", "MTIME", "SIZE"]) @@ -365,7 +366,7 @@ class binarytree(object): pkgindex_lock = None try: if not self._all_directory and os.access(self.pkgdir, os.W_OK): - pkgindex_lock = lockfile(os.path.join(self.pkgdir, "Packages"), + pkgindex_lock = lockfile(self._pkgindex_file, wantnewlockfile=1) self._populate(getbinpkgs, getbinpkgsonly) finally: @@ -385,12 +386,11 @@ class binarytree(object): dirs.remove("All") dirs.sort() dirs.insert(0, "All") - pkgfile = os.path.join(self.pkgdir, "Packages") self._pkgindex = portage.getbinpkg.PackageIndex() header = self._pkgindex.header metadata = self._pkgindex.packages try: - f = open(pkgfile) + f = open(self._pkgindex_file) except EnvironmentError: pass else: @@ -502,7 +502,7 @@ class binarytree(object): for cpv in stale: del metadata[cpv] from portage.util import atomic_ofstream - f = atomic_ofstream(pkgfile) + f = atomic_ofstream(self._pkgindex_file) try: self._pkgindex.write(f) finally: -- cgit v1.2.3-1-g7c22