Gentoo Logo
Gentoo Spaceship

Installation:
Gentoo Handbook
Installation Docs

Documentation:
Home
Listing
About Gentoo
Philosophy
Social Contract

Resources:
Bug Tracker
Developer List
Discussion Forums
Gentoo BitTorrents
Gentoo Linux Enhancement Proposals
IRC Channels
Mailing Lists
Mirrors
Name and Logo Guidelines
Online Package Database
Security Announcements
Staffing Needs
Supporting Vendors
View our CVS

Graphics:
Logos and themes
Icons
ScreenShots

Miscellaneous Resources:
Gentoo Linux Store
Gentoo-hosted projects
IBM dW/Intel article archive




List Archive: gentoo-commits
Navigation:
Lists: gentoo-commits: < Prev By Thread Next > < Prev By Date Next >
Headers:
To: gentoo-commits@g.o
From: "Zac Medico (zmedico)" <zmedico@g.o>
Subject: portage r10939 - main/trunk/pym/_emerge
Date: Sat, 05 Jul 2008 08:52:47 +0000

 1.1

Author: zmedico
Date: 2008-07-05 08:52:46 +0000 (Sat, 05 Jul 2008)
New Revision: 10939

Modified:
   main/trunk/pym/_emerge/__init__.py
Log:
Add async support to EbuildBinpkg by making it inherit from EbuildPhase.


Modified: main/trunk/pym/_emerge/__init__.py
===================================================================
--- main/trunk/pym/_emerge/__init__.py	2008-07-05 08:08:09 UTC (rev 10938)
+++ main/trunk/pym/_emerge/__init__.py	2008-07-05 08:52:46 UTC (rev 10939)
@@ -1805,8 +1805,13 @@
 				if retval != os.EX_OK:
 					return retval
 
-				build = EbuildBinpkg(pkg=pkg, settings=settings)
-				retval = build.execute()
+				build = EbuildBinpkg(pkg=pkg,
+					scheduler=scheduler, settings=settings)
+
+				build.start()
+				scheduler.schedule(build.reg_id)
+				retval = build.wait()
+
 				if retval != os.EX_OK:
 					return retval
 
@@ -2082,19 +2087,15 @@
 			if returncode == os.EX_OK:
 				returncode = portage._post_src_install_checks(settings)
 
-class EbuildBinpkg(Task):
+class EbuildBinpkg(EbuildPhase):
 	"""
 	This assumes that src_install() has successfully completed.
 	"""
-	__slots__ = ("pkg", "settings")
+	__slots__ = ("_binpkg_tmpfile",)
 
-	def _get_hash_key(self):
-		hash_key = getattr(self, "_hash_key", None)
-		if hash_key is None:
-			self._hash_key = ("EbuildBinpkg", self.pkg._get_hash_key())
-		return self._hash_key
-
-	def execute(self):
+	def start(self):
+		self.phase = "package"
+		self.tree = "porttree"
 		pkg = self.pkg
 		root_config = pkg.root_config
 		portdb = root_config.trees["porttree"].dbapi
@@ -2106,30 +2107,24 @@
 		bintree.prevent_collision(pkg.cpv)
 		binpkg_tmpfile = os.path.join(bintree.pkgdir,
 			pkg.cpv + ".tbz2." + str(os.getpid()))
+		self._binpkg_tmpfile = binpkg_tmpfile
 		settings["PORTAGE_BINPKG_TMPFILE"] = binpkg_tmpfile
 		settings.backup_changes("PORTAGE_BINPKG_TMPFILE")
 
-		# Earlier phases should already be done, so
-		# use "noauto" to quietly skip them.
-		settings.features.append("noauto")
-
 		try:
-			retval = portage.doebuild(ebuild_path,
-				"package", root_config.root,
-				settings, debug, mydbapi=portdb,
-				tree="porttree")
+			EbuildPhase.start(self)
 		finally:
 			settings.pop("PORTAGE_BINPKG_TMPFILE", None)
-			try:
-				settings.features.remove("noauto")
-			except ValueError:
-				pass
 
-		if retval == os.EX_OK:
+	def _set_returncode(self, wait_retval):
+		EbuildPhase._set_returncode(self, wait_retval)
+
+		pkg = self.pkg
+		bintree = pkg.root_config.trees["bintree"]
+		binpkg_tmpfile = self._binpkg_tmpfile
+		if self.returncode == os.EX_OK:
 			bintree.inject(pkg.cpv, filename=binpkg_tmpfile)
 
-		return retval
-
 class EbuildMerge(SlotObject):
 
 	__slots__ = ("find_blockers", "logger", "ldpath_mtimes",

-- 
gentoo-commits@g.o mailing list


Navigation:
Lists: gentoo-commits: < Prev By Thread Next > < Prev By Date Next >
Previous by thread:
gentoo-x86 commit in net-p2p/linkage/files: linkage-0.1.2-enable-disable-upnp.patch
Next by thread:
gentoo-x86 commit in media-libs/imlib: ChangeLog imlib-1.9.15-r1.ebuild
Previous by date:
gentoo-x86 commit in media-libs/imlib: imlib-1.9.15-r2.ebuild ChangeLog
Next by date:
gentoo-x86 commit in media-libs/imlib: ChangeLog imlib-1.9.15-r1.ebuild


Aug 29, 2008

Donate to support our development efforts.

Gentoo Centric Hosting: vr.org

VR Hosted

Tek Alchemy

Tek Alchemy

SevenL.net

SevenL.net

php|architect

php|architect

Copyright 2001-2007 Gentoo Foundation, Inc. Questions, Comments? Email www@gentoo.org.