def _correct_build_location(self):<EOL>
if self.source_dir is not None:<EOL><INDENT>return<EOL><DEDENT>assert self.req is not None<EOL>assert self._temp_build_dir.path<EOL>assert (self._ideal_build_dir is not None and<EOL>self._ideal_build_dir.path)  <EOL>old_location = self._temp_build_dir.path<EOL>self._temp_build_dir.path = None<EOL>new_location = self.build_location(self._ideal_build_dir)<EOL>if os.path.exists(new_location):<EOL><INDENT>raise InstallationError(<EOL>'<STR_LIT>'<EOL>% display_path(new_location))<EOL><DEDENT>logger.debug(<EOL>'<STR_LIT>',<EOL>self, display_path(old_location), display_path(new_location),<EOL>)<EOL>shutil.move(old_location, new_location)<EOL>self._temp_build_dir.path = new_location<EOL>self._ideal_build_dir = None<EOL>self.source_dir = os.path.normpath(os.path.abspath(new_location))<EOL>self._egg_info_path = None<EOL>if self.metadata_directory:<EOL><INDENT>old_meta = self.metadata_directory<EOL>rel = os.path.relpath(old_meta, start=old_location)<EOL>new_meta = os.path.join(new_location, rel)<EOL>new_meta = os.path.normpath(os.path.abspath(new_meta))<EOL>self.metadata_directory = new_meta<EOL><DEDENT>
Move self._temp_build_dir to self._ideal_build_dir/self.req.name

        For some requirements (e.g. a path to a directory), the name of the
        package is not available until we run egg_info, so the build_location
        will return a temporary directory and store the _ideal_build_dir.

        This is only called by self.run_egg_info to fix the temporary build
        directory.