summaryrefslogtreecommitdiffstats
path: root/pym
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2008-04-11 19:48:06 +0000
committerZac Medico <zmedico@gentoo.org>2008-04-11 19:48:06 +0000
commitd31dfa840ca5219b0f5641503db3178acbfc1c98 (patch)
treed2cd25236d0a5d2ecb301ffb6006d42445aec1ee /pym
parenta1b12be7612c4c4ce5bb99d6a88332f6098ad228 (diff)
downloadportage-d31dfa840ca5219b0f5641503db3178acbfc1c98.tar.gz
portage-d31dfa840ca5219b0f5641503db3178acbfc1c98.tar.bz2
portage-d31dfa840ca5219b0f5641503db3178acbfc1c98.zip
Make doebuild() bail out early with a PermissionDenied error if there
is no write access to $PKGDIR. svn path=/main/trunk/; revision=9837
Diffstat (limited to 'pym')
-rw-r--r--pym/portage/__init__.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py
index e92669c74..0a240002b 100644
--- a/pym/portage/__init__.py
+++ b/pym/portage/__init__.py
@@ -5006,6 +5006,16 @@ def doebuild(myebuild, mydo, myroot, mysettings, debug=0, listonly=0,
actionmap[x]["dep"] = ' '.join(actionmap_deps[x])
if mydo in actionmap:
+ if mydo == "package":
+ # Make sure the package directory exists before executing
+ # this phase. This can raise PermissionDenied if
+ # the current user doesn't have write access to $PKGDIR.
+ parent_dir = os.path.join(mysettings["PKGDIR"],
+ mysettings["CATEGORY"])
+ portage.util.ensure_dirs(parent_dir)
+ if not os.access(parent_dir, os.W_OK):
+ raise portage.exception.PermissionDenied(
+ "access('%s', os.W_OK)" % parent_dir)
retval = spawnebuild(mydo,
actionmap, mysettings, debug, logfile=logfile)
elif mydo=="qmerge":