From d057d91f391981fb0564873c471d550f2f62edf5 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Mon, 22 Jun 2009 16:43:52 +0000 Subject: Bug #275047 - Split _emerge/__init__.py into smaller pieces. Thanks to Sebastian Mingramm (few) for this patch. svn path=/main/trunk/; revision=13663 --- pym/_emerge/EbuildBinpkg.py | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 pym/_emerge/EbuildBinpkg.py (limited to 'pym/_emerge/EbuildBinpkg.py') diff --git a/pym/_emerge/EbuildBinpkg.py b/pym/_emerge/EbuildBinpkg.py new file mode 100644 index 000000000..3522184fe --- /dev/null +++ b/pym/_emerge/EbuildBinpkg.py @@ -0,0 +1,40 @@ +from _emerge.EbuildProcess import EbuildProcess +import os +class EbuildBinpkg(EbuildProcess): + """ + This assumes that src_install() has successfully completed. + """ + __slots__ = ("_binpkg_tmpfile",) + + def _start(self): + self.phase = "package" + self.tree = "porttree" + pkg = self.pkg + root_config = pkg.root_config + portdb = root_config.trees["porttree"].dbapi + bintree = root_config.trees["bintree"] + ebuild_path = portdb.findname(self.pkg.cpv) + settings = self.settings + debug = settings.get("PORTAGE_DEBUG") == "1" + + 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") + + try: + EbuildProcess._start(self) + finally: + settings.pop("PORTAGE_BINPKG_TMPFILE", None) + + def _set_returncode(self, wait_retval): + EbuildProcess._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) + -- cgit v1.2.3-1-g7c22