Exemplo n.º 1
0
 def skip_checkout(self, buildscript, last_phase):
     # skip the checkout stage if the nonetwork flag is set
     if not self.branch.may_checkout(buildscript):
         if self.check_build_policy(buildscript) == self.PHASE_DONE:
             raise SkipToEnd()
         return True
     return False
Exemplo n.º 2
0
    def checkout(self, buildscript):
        srcdir = self.get_srcdir(buildscript)
        buildscript.set_action(_('Checking out'), self)
        self.branch.checkout(buildscript)
        # did the checkout succeed?
        if not os.path.exists(srcdir):
            raise BuildStateError(_('source directory %s was not created') % srcdir)

        if self.check_build_policy(buildscript) == self.PHASE_DONE:
            raise SkipToEnd()
Exemplo n.º 3
0
    def do_install(self, buildscript):
        if self.check_build_policy(buildscript) == self.PHASE_DONE:
            raise SkipToEnd()

        buildscript.set_action(_('Installing'), self)
        destdir = self.prepare_installroot(buildscript)
        tempdir = tempfile.mkdtemp()

        for python in self.python:
            cmd = [python, '-m', 'pip']
            cmd.extend([
                'install', '--verbose', '--no-dependencies',
                '--ignore-installed', '--prefix', buildscript.config.prefix,
                '--src',
                os.path.join(tempdir, 'src'), '--root', destdir
            ] + self.branch.version.split())
            buildscript.execute(cmd, cwd=tempdir, extra_env=self.extra_env)

        self.process_install(buildscript, self.branch.version)

        shutil.rmtree(tempdir)