def UpdateVersion(self, rpcserver, basepath, appyaml, server_yaml_path,
                    backend=None):

    if self.options.precompilation:
      if not appyaml.derived_file_type:
        appyaml.derived_file_type = []
      if appinfo.PYTHON_PRECOMPILED not in appyaml.derived_file_type:
        appyaml.derived_file_type.append(appinfo.PYTHON_PRECOMPILED)

    paths = self.file_iterator(basepath, appyaml.skip_files, appyaml.runtime)
    openfunc = lambda path: self.opener(os.path.join(basepath, path), 'rb')

    if appyaml.runtime == 'go':


      goroot = os.path.join(os.path.dirname(google.appengine.__file__),
                            '../../goroot')
      gopath = os.environ.get('GOPATH')
      if os.path.isdir(goroot) and gopath:
        app_paths = list(paths)
        go_files = [f for f in app_paths
                    if f.endswith('.go') and not appyaml.nobuild_files.match(f)]
        if not go_files:
          raise Exception('no Go source files to upload '
                          '(-nobuild_files applied)')
        gab_argv = [
            os.path.join(goroot, 'bin', 'go-app-builder'),
            '-app_base', self.basepath,
            '-arch', '6',
            '-gopath', gopath,
            '-goroot', goroot,
            '-print_extras',
        ] + go_files
        try:
          p = subprocess.Popen(gab_argv, stdout=subprocess.PIPE,
                               stderr=subprocess.PIPE, env={})
          rc = p.wait()
        except Exception, e:
          raise Exception('failed running go-app-builder', e)
        if rc != 0:
          raise Exception(p.stderr.read())




        overlay = dict([l.split('|') for l in p.stdout.read().split('\n') if l])
        logging.info('GOPATH overlay: %s', overlay)

        def ofunc(path):
          if path in overlay:
            return self.opener(overlay[path], 'rb')
          return self.opener(os.path.join(basepath, path), 'rb')
        paths = app_paths + overlay.keys()
        openfunc = ofunc

    appversion = AppVersionUpload(rpcserver,
                                  appyaml,
                                  server_yaml_path=server_yaml_path,
                                  backend=backend,
                                  error_fh=self.error_fh)
    return appversion.DoUpload(paths, openfunc)
Updates and deploys a new appversion.
dataset/ETHPy150Open AppScale/appscale/AppServer/google/appengine/tools/appcfg.py/AppCfgApp.UpdateVersion