def _start(self): if self.phase == 'prerm': env_extractor = BinpkgEnvExtractor(background=self.background, scheduler=self.scheduler, settings=self.settings) if env_extractor.saved_env_exists(): self._start_task(env_extractor, self._env_extractor_exit) return # If the environment.bz2 doesn't exist, then ebuild.sh will # source the ebuild as a fallback. self._start_ebuild()
def _async_start_exit(self, task): task.future.cancelled() or task.future.result() if self._default_exit(task) != os.EX_OK: self.wait() return if self.phase in ("pretend", "prerm"): env_extractor = BinpkgEnvExtractor(background=self.background, scheduler=self.scheduler, settings=self.settings) if env_extractor.saved_env_exists(): self._start_task(env_extractor, self._env_extractor_exit) return # If the environment.bz2 doesn't exist, then ebuild.sh will # source the ebuild as a fallback. self._start_lock()
def _start(self): need_builddir = self.phase not in EbuildProcess._phases_without_builddir if need_builddir: phase_completed_file = os.path.join( self.settings['PORTAGE_BUILDDIR'], ".%sed" % self.phase.rstrip('e')) if not os.path.exists(phase_completed_file): # If the phase is really going to run then we want # to eliminate any stale elog messages that may # exist from a previous run. try: os.unlink( os.path.join(self.settings['T'], 'logging', self.phase)) except OSError: pass if self.phase in ('nofetch', 'pretend', 'setup'): use = self.settings.get('PORTAGE_BUILT_USE') if use is None: use = self.settings['PORTAGE_USE'] maint_str = "" upstr_str = "" metadata_xml_path = os.path.join( os.path.dirname(self.settings['EBUILD']), "metadata.xml") if MetaDataXML is not None and os.path.isfile(metadata_xml_path): herds_path = os.path.join(self.settings['PORTDIR'], 'metadata/herds.xml') try: metadata_xml = MetaDataXML(metadata_xml_path, herds_path) maint_str = metadata_xml.format_maintainer_string() upstr_str = metadata_xml.format_upstream_string() except SyntaxError: maint_str = "<invalid metadata.xml>" msg = [] msg.append("Package: %s" % self.settings.mycpv) if self.settings.get('PORTAGE_REPO_NAME'): msg.append("Repository: %s" % self.settings['PORTAGE_REPO_NAME']) if maint_str: msg.append("Maintainer: %s" % maint_str) if upstr_str: msg.append("Upstream: %s" % upstr_str) msg.append("USE: %s" % use) relevant_features = [] enabled_features = self.settings.features for x in self._features_display: if x in enabled_features: relevant_features.append(x) if relevant_features: msg.append("FEATURES: %s" % " ".join(relevant_features)) # Force background=True for this header since it's intended # for the log and it doesn't necessarily need to be visible # elsewhere. self._elog('einfo', msg, background=True) if self.phase == 'package': if 'PORTAGE_BINPKG_TMPFILE' not in self.settings: self.settings['PORTAGE_BINPKG_TMPFILE'] = \ os.path.join(self.settings['PKGDIR'], self.settings['CATEGORY'], self.settings['PF']) + '.tbz2' if self.phase in ("pretend", "prerm"): env_extractor = BinpkgEnvExtractor(background=self.background, scheduler=self.scheduler, settings=self.settings) if env_extractor.saved_env_exists(): self._start_task(env_extractor, self._env_extractor_exit) return # If the environment.bz2 doesn't exist, then ebuild.sh will # source the ebuild as a fallback. self._start_lock()
def _start(self): need_builddir = self.phase not in EbuildProcess._phases_without_builddir if need_builddir: phase_completed_file = os.path.join( self.settings['PORTAGE_BUILDDIR'], ".%sed" % self.phase.rstrip('e')) if not os.path.exists(phase_completed_file): # If the phase is really going to run then we want # to eliminate any stale elog messages that may # exist from a previous run. try: os.unlink(os.path.join(self.settings['T'], 'logging', self.phase)) except OSError: pass if self.phase in ('nofetch', 'pretend', 'setup'): use = self.settings.get('PORTAGE_BUILT_USE') if use is None: use = self.settings['PORTAGE_USE'] maint_str = "" upstr_str = "" metadata_xml_path = os.path.join(os.path.dirname(self.settings['EBUILD']), "metadata.xml") if MetaDataXML is not None and os.path.isfile(metadata_xml_path): herds_path = os.path.join(self.settings['PORTDIR'], 'metadata/herds.xml') try: metadata_xml = MetaDataXML(metadata_xml_path, herds_path) maint_str = metadata_xml.format_maintainer_string() upstr_str = metadata_xml.format_upstream_string() except SyntaxError: maint_str = "<invalid metadata.xml>" msg = [] msg.append("Package: %s" % self.settings.mycpv) if self.settings.get('PORTAGE_REPO_NAME'): msg.append("Repository: %s" % self.settings['PORTAGE_REPO_NAME']) if maint_str: msg.append("Maintainer: %s" % maint_str) if upstr_str: msg.append("Upstream: %s" % upstr_str) msg.append("USE: %s" % use) relevant_features = [] enabled_features = self.settings.features for x in self._features_display: if x in enabled_features: relevant_features.append(x) if relevant_features: msg.append("FEATURES: %s" % " ".join(relevant_features)) # Force background=True for this header since it's intended # for the log and it doesn't necessarily need to be visible # elsewhere. self._elog('einfo', msg, background=True) if self.phase == 'package': if 'PORTAGE_BINPKG_TMPFILE' not in self.settings: self.settings['PORTAGE_BINPKG_TMPFILE'] = \ os.path.join(self.settings['PKGDIR'], self.settings['CATEGORY'], self.settings['PF']) + '.tbz2' if self.phase in ("pretend", "prerm"): env_extractor = BinpkgEnvExtractor(background=self.background, scheduler=self.scheduler, settings=self.settings) if env_extractor.saved_env_exists(): self._start_task(env_extractor, self._env_extractor_exit) return # If the environment.bz2 doesn't exist, then ebuild.sh will # source the ebuild as a fallback. self._start_lock()