1 |
Author: zmedico |
2 |
Date: 2008-04-11 19:55:50 +0000 (Fri, 11 Apr 2008) |
3 |
New Revision: 9838 |
4 |
|
5 |
Modified: |
6 |
main/branches/2.1.2/pym/portage.py |
7 |
Log: |
8 |
Make doebuild() bail out early with a PermissionDenied error if there |
9 |
is no write access to $PKGDIR. (trunk r9837) |
10 |
|
11 |
|
12 |
Modified: main/branches/2.1.2/pym/portage.py |
13 |
=================================================================== |
14 |
--- main/branches/2.1.2/pym/portage.py 2008-04-11 19:48:06 UTC (rev 9837) |
15 |
+++ main/branches/2.1.2/pym/portage.py 2008-04-11 19:55:50 UTC (rev 9838) |
16 |
@@ -5005,10 +5005,15 @@ |
17 |
|
18 |
if mydo in actionmap: |
19 |
if mydo=="package": |
20 |
- portage_util.ensure_dirs( |
21 |
- os.path.join(mysettings["PKGDIR"], mysettings["CATEGORY"])) |
22 |
- portage_util.ensure_dirs( |
23 |
- os.path.join(mysettings["PKGDIR"], "All")) |
24 |
+ # Make sure the package directory exists before executing |
25 |
+ # this phase. This can raise PermissionDenied if |
26 |
+ # the current user doesn't have write access to $PKGDIR. |
27 |
+ for parent_dir in ("All", mysettings["CATEGORY"]): |
28 |
+ parent_dir = os.path.join(mysettings["PKGDIR"], parent_dir) |
29 |
+ portage_util.ensure_dirs(parent_dir) |
30 |
+ if not os.access(parent_dir, os.W_OK): |
31 |
+ raise portage_exception.PermissionDenied( |
32 |
+ "access('%s', os.W_OK)" % parent_dir) |
33 |
retval = spawnebuild(mydo, |
34 |
actionmap, mysettings, debug, logfile=logfile) |
35 |
elif mydo=="qmerge": |
36 |
|
37 |
-- |
38 |
gentoo-commits@l.g.o mailing list |