コード例 #1
0
    def _fetch_exit(self, fetcher):

        if fetcher is not None and \
         self._default_exit(fetcher) != os.EX_OK:
            self._fetch_failed()
            return

        # discard successful fetch log
        self._build_dir.clean_log()
        pkg = self.pkg
        logger = self.logger
        opts = self.opts
        pkg_count = self.pkg_count
        scheduler = self.scheduler
        settings = self.settings
        features = settings.features
        ebuild_path = self._ebuild_path
        system_set = pkg.root_config.sets["system"]

        #buildsyspkg: Check if we need to _force_ binary package creation
        self._issyspkg = "buildsyspkg" in features and \
          system_set.findAtomForPackage(pkg) and \
          "buildpkg" not in features and \
          opts.buildpkg != 'n'

        if ("buildpkg" in features or self._issyspkg) \
         and not self.opts.buildpkg_exclude.findAtomForPackage(pkg):

            self._buildpkg = True

            msg = " === (%s of %s) Compiling/Packaging (%s::%s)" % \
             (pkg_count.curval, pkg_count.maxval, pkg.cpv, ebuild_path)
            short_msg = "emerge: (%s of %s) %s Compile" % \
             (pkg_count.curval, pkg_count.maxval, pkg.cpv)
            logger.log(msg, short_msg=short_msg)

        else:
            msg = " === (%s of %s) Compiling/Merging (%s::%s)" % \
             (pkg_count.curval, pkg_count.maxval, pkg.cpv, ebuild_path)
            short_msg = "emerge: (%s of %s) %s Compile" % \
             (pkg_count.curval, pkg_count.maxval, pkg.cpv)
            logger.log(msg, short_msg=short_msg)

        build = EbuildExecuter(background=self.background,
                               pkg=pkg,
                               scheduler=scheduler,
                               settings=settings)
        self._start_task(build, self._build_exit)
コード例 #2
0
    def _fetch_exit(self, fetcher):
        opts = self.opts
        pkg = self.pkg

        fetch_failed = False
        if opts.fetchonly:
            fetch_failed = self._final_exit(fetcher) != os.EX_OK
        else:
            fetch_failed = self._default_exit(fetcher) != os.EX_OK

        if fetch_failed and fetcher.logfile is not None and \
         os.path.exists(fetcher.logfile):
            self.settings["PORTAGE_LOG_FILE"] = fetcher.logfile

        if fetch_failed or opts.fetchonly:
            self.wait()
            return

        logger = self.logger
        opts = self.opts
        pkg_count = self.pkg_count
        scheduler = self.scheduler
        settings = self.settings
        features = settings.features
        ebuild_path = self._ebuild_path
        system_set = pkg.root_config.sets["system"]

        self._build_dir = EbuildBuildDir(pkg=pkg, settings=settings)
        self._build_dir.lock()

        # Cleaning is triggered before the setup
        # phase, in portage.doebuild().
        msg = " === (%s of %s) Cleaning (%s::%s)" % \
         (pkg_count.curval, pkg_count.maxval, pkg.cpv, ebuild_path)
        short_msg = "emerge: (%s of %s) %s Clean" % \
         (pkg_count.curval, pkg_count.maxval, pkg.cpv)
        logger.log(msg, short_msg=short_msg)

        #buildsyspkg: Check if we need to _force_ binary package creation
        self._issyspkg = "buildsyspkg" in features and \
          system_set.findAtomForPackage(pkg) and \
          not opts.buildpkg

        if opts.buildpkg or self._issyspkg:

            self._buildpkg = True

            msg = " === (%s of %s) Compiling/Packaging (%s::%s)" % \
             (pkg_count.curval, pkg_count.maxval, pkg.cpv, ebuild_path)
            short_msg = "emerge: (%s of %s) %s Compile" % \
             (pkg_count.curval, pkg_count.maxval, pkg.cpv)
            logger.log(msg, short_msg=short_msg)

        else:
            msg = " === (%s of %s) Compiling/Merging (%s::%s)" % \
             (pkg_count.curval, pkg_count.maxval, pkg.cpv, ebuild_path)
            short_msg = "emerge: (%s of %s) %s Compile" % \
             (pkg_count.curval, pkg_count.maxval, pkg.cpv)
            logger.log(msg, short_msg=short_msg)

        build = EbuildExecuter(background=self.background,
                               pkg=pkg,
                               scheduler=scheduler,
                               settings=settings)
        self._start_task(build, self._build_exit)