summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2007-10-18 02:41:45 +0000
committerZac Medico <zmedico@gentoo.org>2007-10-18 02:41:45 +0000
commit2043a5aeb47281c7474aa768f93889987ff18784 (patch)
tree7692619b7794d9c0680b115c85c53850880139de
parent635df1356525a30bf236951c7a402f4eb70a249e (diff)
downloadportage-2043a5aeb47281c7474aa768f93889987ff18784.tar.gz
portage-2043a5aeb47281c7474aa768f93889987ff18784.tar.bz2
portage-2043a5aeb47281c7474aa768f93889987ff18784.zip
Fix collision-protect so that it properly cancels the
preinst phase like it used to. (trunk r8168) svn path=/main/branches/2.1.2/; revision=8169
-rw-r--r--pym/portage.py48
1 files changed, 26 insertions, 22 deletions
diff --git a/pym/portage.py b/pym/portage.py
index bbe2afdd1..9aac8f5d2 100644
--- a/pym/portage.py
+++ b/pym/portage.py
@@ -8001,30 +8001,13 @@ class dblink:
if stopmerge:
collisions.append(f)
- if True:
- """ The merge process may move files out of the image directory,
- which causes invalidation of the .installed flag."""
- try:
- os.unlink(os.path.join(
- os.path.dirname(normalize_path(srcroot)), ".installed"))
- except OSError, e:
- if e.errno != errno.ENOENT:
- raise
- del e
-
- self.dbdir = self.dbtmpdir
- self.delete()
- if not os.path.exists(self.dbtmpdir):
- os.makedirs(self.dbtmpdir)
-
- writemsg_stdout(">>> Merging %s %s %s\n" % (self.mycpv,"to",destroot))
-
- # run preinst script
+ # Make sure the ebuild environment is initialized and that ${T}/elog
+ # exists for logging of collision-protect eerror messages.
if myebuild is None:
myebuild = os.path.join(inforoot, self.pkg + ".ebuild")
- a = doebuild(myebuild, "preinst", destroot, self.settings, cleanup=cleanup,
- use_cache=0, tree=self.treetype, mydbapi=mydbapi,
- vartree=self.vartree)
+ doebuild_environment(myebuild, "preinst", destroot,
+ self.settings, 0, 0, mydbapi)
+ prepare_build_dirs(destroot, self.settings, cleanup)
def eerror(lines):
cmd = "source '%s/isolated-functions.sh' ; " % PORTAGE_BIN_PATH
@@ -8107,6 +8090,27 @@ class dblink:
" packages claim the file(s)."])
return 1
+ writemsg_stdout(">>> Merging %s to %s\n" % (self.mycpv, destroot))
+
+ # The merge process may move files out of the image directory,
+ # which causes invalidation of the .installed flag.
+ try:
+ os.unlink(os.path.join(
+ os.path.dirname(normalize_path(srcroot)), ".installed"))
+ except OSError, e:
+ if e.errno != errno.ENOENT:
+ raise
+ del e
+
+ self.dbdir = self.dbtmpdir
+ self.delete()
+ portage_util.ensure_dirs(self.dbtmpdir)
+
+ # run preinst script
+ a = doebuild(myebuild, "preinst", destroot, self.settings,
+ use_cache=0, tree=self.treetype, mydbapi=mydbapi,
+ vartree=self.vartree)
+
# XXX: Decide how to handle failures here.
if a != os.EX_OK:
writemsg("!!! FAILED preinst: "+str(a)+"\n", noiselevel=-1)