1 |
commit: 2942ff81aab3accf6e2408b7cc84056700b667db |
2 |
Author: Zac Medico <zmedico <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Jun 30 06:56:36 2011 +0000 |
4 |
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Jun 30 06:56:36 2011 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=2942ff81 |
7 |
|
8 |
ebuild(1): use bintree.inject for "package" phase |
9 |
|
10 |
--- |
11 |
pym/portage/package/ebuild/doebuild.py | 13 +++++++++++-- |
12 |
1 files changed, 11 insertions(+), 2 deletions(-) |
13 |
|
14 |
diff --git a/pym/portage/package/ebuild/doebuild.py b/pym/portage/package/ebuild/doebuild.py |
15 |
index 4b4eaec..267f4af 100644 |
16 |
--- a/pym/portage/package/ebuild/doebuild.py |
17 |
+++ b/pym/portage/package/ebuild/doebuild.py |
18 |
@@ -826,14 +826,18 @@ def doebuild(myebuild, mydo, myroot, mysettings, debug=0, listonly=0, |
19 |
actionmap[x]["dep"] = ' '.join(actionmap_deps[x]) |
20 |
|
21 |
if mydo in actionmap: |
22 |
+ bintree = None |
23 |
if mydo == "package": |
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 |
if hasattr(portage, 'db'): |
28 |
bintree = portage.db[mysettings["ROOT"]]["bintree"] |
29 |
- bintree._ensure_dir(os.path.join( |
30 |
- bintree.pkgdir, mysettings["CATEGORY"])) |
31 |
+ mysettings["PORTAGE_BINPKG_TMPFILE"] = \ |
32 |
+ bintree.getname(mysettings.mycpv) + \ |
33 |
+ ".%s" % (os.getpid(),) |
34 |
+ bintree._ensure_dir(os.path.dirname( |
35 |
+ mysettings["PORTAGE_BINPKG_TMPFILE"])) |
36 |
else: |
37 |
parent_dir = os.path.join(mysettings["PKGDIR"], |
38 |
mysettings["CATEGORY"]) |
39 |
@@ -844,6 +848,11 @@ def doebuild(myebuild, mydo, myroot, mysettings, debug=0, listonly=0, |
40 |
retval = spawnebuild(mydo, |
41 |
actionmap, mysettings, debug, logfile=logfile, |
42 |
fd_pipes=fd_pipes, returnpid=returnpid) |
43 |
+ |
44 |
+ if retval == os.EX_OK: |
45 |
+ if mydo == "package" and bintree is not None: |
46 |
+ bintree.inject(mysettings.mycpv, |
47 |
+ filename=mysettings["PORTAGE_BINPKG_TMPFILE"]) |
48 |
elif mydo=="qmerge": |
49 |
# check to ensure install was run. this *only* pops up when users |
50 |
# forget it and are using ebuild |