Ejemplo n.º 1
0
def MODEtrace(_outdir, state):
    """Shortcut to use trace_inputs.py properly.

  It constructs the equivalent of dictfiles. It is hardcoded to base the
  checkout at src/.
  """
    logging.info('Running %s, cwd=%s' %
                 (state.result.command,
                  os.path.join(state.root_dir, state.result.relative_cwd)))
    product_dir = None
    if state.resultdir and state.root_dir:
        # Defaults to none if both are the same directory.
        try:
            product_dir = os.path.relpath(state.resultdir,
                                          state.root_dir) or None
        except ValueError:
            # This happens on Windows if state.resultdir is one drive, let's say
            # 'C:\' and state.root_dir on another one like 'D:\'.
            product_dir = None
    if not state.result.command:
        print 'No command to run'
        return 1
    return trace_inputs.trace_inputs(state.result_file + '.log',
                                     state.result.command, state.root_dir,
                                     state.result.relative_cwd, product_dir,
                                     False)
Ejemplo n.º 2
0
def MODEtrace(_outdir, state):
  """Shortcut to use trace_inputs.py properly.

  It constructs the equivalent of dictfiles. It is hardcoded to base the
  checkout at src/.
  """
  logging.info(
      'Running %s, cwd=%s' % (
          state.result.command,
          os.path.join(state.root_dir, state.result.relative_cwd)))
  product_dir = None
  if state.resultdir and state.root_dir:
    # Defaults to none if both are the same directory.
    try:
      product_dir = os.path.relpath(state.resultdir, state.root_dir) or None
    except ValueError:
      # This happens on Windows if state.resultdir is one drive, let's say
      # 'C:\' and state.root_dir on another one like 'D:\'.
      product_dir = None
  if not state.result.command:
    print 'No command to run'
    return 1
  return trace_inputs.trace_inputs(
      state.result_file + '.log',
      state.result.command,
      state.root_dir,
      state.result.relative_cwd,
      product_dir,
      False)
Ejemplo n.º 3
0
def MODEtrace(
    _outdir, indir, _dictfiles, _read_only, cmd, relative_cwd, resultfile):
  """Shortcut to use trace_inputs.py properly.

  It constructs the equivalent of dictfiles. It is hardcoded to base the
  checkout at src/.
  """
  logging.info('Running %s, cwd=%s' % (cmd, os.path.join(indir, relative_cwd)))
  return trace_inputs.trace_inputs(
      '%s.log' % resultfile,
      cmd,
      indir,
      relative_cwd,
      os.path.relpath(os.path.dirname(resultfile), indir),  # Guesswork here.
      False)
Ejemplo n.º 4
0
def MODEtrace(_outdir, indir, _dictfiles, _read_only, cmd, relative_cwd,
              resultfile):
    """Shortcut to use trace_inputs.py properly.

  It constructs the equivalent of dictfiles. It is hardcoded to base the
  checkout at src/.
  """
    logging.info('Running %s, cwd=%s' %
                 (cmd, os.path.join(indir, relative_cwd)))
    return trace_inputs.trace_inputs(
        '%s.log' % resultfile,
        cmd,
        indir,
        relative_cwd,
        os.path.relpath(os.path.dirname(resultfile), indir),  # Guesswork here.
        False)
Ejemplo n.º 5
0
def MODEtrace(_outdir, indir, _dictfiles, _read_only, cmd, relative_cwd,
              resultfile):
    """Shortcut to use trace_inputs.py properly.

  It constructs the equivalent of dictfiles. It is hardcoded to base the
  checkout at src/.
  """
    logging.info('Running %s, cwd=%s' %
                 (cmd, os.path.join(indir, relative_cwd)))
    if resultfile:
        # Guesswork here.
        product_dir = os.path.dirname(resultfile)
        if product_dir and indir:
            product_dir = os.path.relpath(product_dir, indir)
    else:
        product_dir = None
    if not cmd:
        print 'No command to run'
        return 1
    return trace_inputs.trace_inputs('%s.log' % resultfile, cmd, indir,
                                     relative_cwd, product_dir, False)