diff options
author | Zac Medico <zmedico@gentoo.org> | 2007-05-23 00:37:01 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2007-05-23 00:37:01 +0000 |
commit | e333806ae0a2b7099c3be6179c4ac65abe0e2896 (patch) | |
tree | ca4e137eb47580b52f4e20806ac970160b742f95 | |
parent | 704b6281b086a967748e43dee51ed74810faac92 (diff) | |
download | portage-e333806ae0a2b7099c3be6179c4ac65abe0e2896.tar.gz portage-e333806ae0a2b7099c3be6179c4ac65abe0e2896.tar.bz2 portage-e333806ae0a2b7099c3be6179c4ac65abe0e2896.zip |
Store the path of $PKGDIR/Packages as binarytree._pkgindex_file.
svn path=/main/trunk/; revision=6588
-rw-r--r-- | pym/portage/dbapi/bintree.py | 8 |
1 files 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: |