summaryrefslogtreecommitdiffstats
path: root/pym/getbinpkg.py
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2007-11-20 23:59:51 +0000
committerZac Medico <zmedico@gentoo.org>2007-11-20 23:59:51 +0000
commitf41104f3be7de9abdb061d96f09fc2d512286a8c (patch)
tree90dd9e59c461a4d0953a5b60c40518a546f5d0e8 /pym/getbinpkg.py
parent1c991a8ccd83c97ec6b37ca70453b11dc781e2ff (diff)
downloadportage-f41104f3be7de9abdb061d96f09fc2d512286a8c.tar.gz
portage-f41104f3be7de9abdb061d96f09fc2d512286a8c.tar.bz2
portage-f41104f3be7de9abdb061d96f09fc2d512286a8c.zip
Make dir_get_metadata() return early if the current user does
not have write access to /var/cache/edb. Thanks to Cardoe for reporting. (trunk r8502) svn path=/main/branches/2.1.2/; revision=8561
Diffstat (limited to 'pym/getbinpkg.py')
-rw-r--r--pym/getbinpkg.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/pym/getbinpkg.py b/pym/getbinpkg.py
index f8529d79e..b57da2ca1 100644
--- a/pym/getbinpkg.py
+++ b/pym/getbinpkg.py
@@ -455,6 +455,8 @@ def dir_get_metadata(baseurl, conn=None, chunk_size=3000, verbose=1, usingcache=
else:
keepconnection = 1
+ cache_path = "/var/cache/edb"
+
if makepickle is None:
makepickle = "/var/cache/edb/metadata.idx.most_recent"
@@ -482,6 +484,11 @@ def dir_get_metadata(baseurl, conn=None, chunk_size=3000, verbose=1, usingcache=
if not metadata[baseurl].has_key("data"):
metadata[baseurl]["data"]={}
+ if not os.access(cache_path, os.W_OK):
+ sys.stderr.write("!!! Unable to write binary metadata to disk!\n")
+ sys.stderr.write("!!! Permission denied: '%s'\n" % cache_path)
+ return metadata[baseurl]["data"]
+
filelist = dir_get_list(baseurl, conn)
tbz2list = match_in_array(filelist, suffix=".tbz2")
metalist = match_in_array(filelist, prefix="metadata.idx")