From: Zac Medico Date: Tue, 17 Aug 2010 18:55:13 +0000 (-0700) Subject: Use binarytree._ensure_dir() to create the binpkg parent dir. X-Git-Tag: v2.2_rc68~117 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=7c30e35b614171fa26097944fa0d48e8de88f486;p=portage.git Use binarytree._ensure_dir() to create the binpkg parent dir. --- 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)