diff options
Diffstat (limited to 'pym/portage/package')
-rw-r--r-- | pym/portage/package/ebuild/doebuild.py | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/pym/portage/package/ebuild/doebuild.py b/pym/portage/package/ebuild/doebuild.py index 75dab8738..f77c9a456 100644 --- a/pym/portage/package/ebuild/doebuild.py +++ b/pym/portage/package/ebuild/doebuild.py @@ -722,12 +722,17 @@ def doebuild(myebuild, mydo, myroot, mysettings, debug=0, listonly=0, # 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 PermissionDenied( - "access('%s', os.W_OK)" % parent_dir) + if hasattr(portage, 'db'): + bintree = portage.db[mysettings["ROOT"]]["bintree"] + bintree._ensure_dir(os.path.join( + bintree.pkgdir, mysettings["CATEGORY"])) + else: + 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 PermissionDenied( + "access('%s', os.W_OK)" % parent_dir) retval = spawnebuild(mydo, actionmap, mysettings, debug, logfile=logfile, fd_pipes=fd_pipes, returnpid=returnpid) |