From 7c30e35b614171fa26097944fa0d48e8de88f486 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Tue, 17 Aug 2010 11:55:13 -0700 Subject: [PATCH] Use binarytree._ensure_dir() to create the binpkg parent dir. --- pym/portage/package/ebuild/doebuild.py | 17 +++++++++++------ 1 file 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) -- 2.26.2