From: Zac Medico Date: Sat, 10 Dec 2011 03:55:36 +0000 (-0800) Subject: Binpkg: handle missing dir after chpathtool X-Git-Tag: v2.2.0_alpha80~34 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=7c0ba941760c32d123dc225fe797f509195831cb;p=portage.git Binpkg: handle missing dir after chpathtool --- diff --git a/pym/_emerge/Binpkg.py b/pym/_emerge/Binpkg.py index 57b170f53..49368780c 100644 --- a/pym/_emerge/Binpkg.py +++ b/pym/_emerge/Binpkg.py @@ -351,11 +351,17 @@ class Binpkg(CompositeTask): # Move the files to the correct location for merge. image_tmp_dir = os.path.join( self.settings["PORTAGE_BUILDDIR"], "image_tmp") - os.rename(os.path.join(self.settings["D"], - self._build_prefix.lstrip(os.sep)), image_tmp_dir) - shutil.rmtree(self._image_dir) - ensure_dirs(os.path.dirname(self.settings["ED"].rstrip(os.sep))) - os.rename(image_tmp_dir, self.settings["ED"]) + build_d = os.path.join(self.settings["D"], + self._build_prefix.lstrip(os.sep)) + if not os.path.isdir(build_d): + # Assume this is a virtual package or something. + shutil.rmtree(self._image_dir) + ensure_dirs(self.settings["ED"]) + else: + os.rename(build_d, image_tmp_dir) + shutil.rmtree(self._image_dir) + ensure_dirs(os.path.dirname(self.settings["ED"].rstrip(os.sep))) + os.rename(image_tmp_dir, self.settings["ED"]) self.wait()