aboutsummaryrefslogtreecommitdiff
path: root/openssl/trunk/test/ssltest.c
blob: 40191f0da24210602c061f7fcf7a85dcac301ae4 (plain) (blame)
1
../ssl/ssltest.c
color: #B06; font-weight: bold } /* Name.Class */ .highlight .no { color: #036; font-weight: bold } /* Name.Constant */ .highlight .nd { color: #555 } /* Name.Decorator */ .highlight .ne { color: #B06; font-weight: bold } /* Name.Exception */ .highlight .nf { color: #06B; font-weight: bold } /* Name.Function */ .highlight .nl { color: #369; font-style: italic } /* Name.Label */ .highlight .nn { color: #B06; font-weight: bold } /* Name.Namespace */ .highlight .py { color: #369; font-weight: bold } /* Name.Property */ .highlight .nt { color: #B06; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #369 } /* Name.Variable */ .highlight .ow { color: #080 } /* Operator.Word */ .highlight .w { color: #BBB } /* Text.Whitespace */ .highlight .mb { color: #00D; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #00D; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #00D; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #00D; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #00D; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #D20; background-color: #FFF0F0 } /* Literal.String.Affix */ .highlight .sb { color: #D20; background-color: #FFF0F0 } /* Literal.String.Backtick */ .highlight .sc { color: #D20; background-color: #FFF0F0 } /* Literal.String.Char */ .highlight .dl { color: #D20; background-color: #FFF0F0 } /* Literal.String.Delimiter */ .highlight .sd { color: #D20; background-color: #FFF0F0 } /* Literal.String.Doc */ .highlight .s2 { color: #D20; background-color: #FFF0F0 } /* Literal.String.Double */ .highlight .se { color: #04D; background-color: #FFF0F0 } /* Literal.String.Escape */ .highlight .sh { color: #D20; background-color: #FFF0F0 } /* Literal.String.Heredoc */ .highlight .si { color: #33B; background-color: #FFF0F0 } /* Literal.String.Interpol */ .highlight .sx { color: #2B2; background-color: #F0FFF0 } /* Literal.String.Other */ .highlight .sr { color: #080; background-color: #FFF0FF } /* Literal.String.Regex */ .highlight .s1 { color: #D20; background-color: #FFF0F0 } /* Literal.String.Single */ .highlight .ss { color: #A60; background-color: #FFF0F0 } /* Literal.String.Symbol */ .highlight .bp { color: #038 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #06B; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #369 } /* Name.Variable.Class */ .highlight .vg { color: #D70 } /* Name.Variable.Global */ .highlight .vi { color: #33B } /* Name.Variable.Instance */ .highlight .vm { color: #369 } /* Name.Variable.Magic */ .highlight .il { color: #00D; font-weight: bold } /* Literal.Number.Integer.Long */
# $Id$
#
# This module extends the stock distutils install_setup code to
# support installation into multiple target directories, with
# semantics similar to what distutils already supports for
# script_files.  The bulk of this code is taken directly from the
# stock distutils package, with minor changes.  As such, I consider
# this to be a derivative work of the distutils package for copyright
# purposes.

from distutils.util import change_root, convert_path
from distutils.command.build_scripts   import build_scripts   as _build_scripts
from distutils.command.install_scripts import install_scripts as _install_scripts
from distutils import log
from stat import S_IMODE
import os

class build_scripts(_build_scripts):
  """
  Hacked version of distutils.build_scripts, designed to support
  multiple target installation directories like install_data does.

  [(target_directory, [list_of_source_scripts]), ...]

  Most of the real work is in the companion hacked install_scripts,
  but we need to tweak the list of source files that build_scripts
  pulls out of the Distribution object.
  """

  def finalize_options(self):
    _build_scripts.finalize_options(self)
    self.scripts = []
    for script in self.distribution.scripts:
      if isinstance(script, str):
        self.scripts.append(script)
      else:        
        self.scripts.extend(script[1])

class install_scripts(_install_scripts):
  """
  Hacked version of distutils.install_scripts, designed to support
  multiple target installation directories like install_data does.

  [(target_directory, [list_of_source_scripts]), ...]

  The code here is a tweaked combination of what the stock
  install_scripts and install_data classes do.
  """

  user_options = _install_scripts.user_options + [
    ("root=", None, "install everything relative to this alternate root directory")]

  def initialize_options(self):
    _install_scripts.initialize_options(self)
    self.outfiles = []
    self.root = None

  def finalize_options (self):
    self.set_undefined_options("build",
                               ("build_scripts", "build_dir"))
    self.set_undefined_options("install",
                               ("install_scripts", "install_dir"),
                               ("root", "root"),
                               ("force", "force"),
                               ("skip_build", "skip_build"))

  def run(self):
    if not self.skip_build:
      self.run_command("build_scripts")
    for script in self.distribution.scripts:
      if isinstance(script, str):
        fn = os.path.join(self.build_dir, os.path.basename(convert_path(script)))
        out, _ = self.copy_file(fn, self.install_dir)
        self.outfiles.append(out)
      else:
        dn = convert_path(script[0])
        if not os.path.isabs(dn):
          dn = os.path.join(self.install_dir, dn)
        elif self.root:
          dn = change_root(self.root, dn)
        self.mkpath(dn)
        if not script[1]:
          self.outfiles.append(dn)
        else:
          for s in script[1]:
            fn = os.path.join(self.build_dir, os.path.basename(convert_path(s)))
            out, _ = self.copy_file(fn, dn)
            self.outfiles.append(out)
    if os.name == "posix":
      for fn in self.get_outputs():
        mode = S_IMODE(os.stat(fn).st_mode) | 0555
        log.info("changing mode of %s to %o", fn, mode)
        if not self.dry_run:
          os.chmod(fn, mode)