Exemplo n.º 1
0
def loadThroughPath(path):
  """ recursively loads signore files in 'path' and all parent
      directories of 'path' up to (and including) the build root.
      This will not load signore files from directories outside
      the buildroot. """

  global allIgnoreFiles

  buildRoot = paths.getBuildRoot()
  absBuildRoot = os.path.abspath(buildRoot)

  thisPath = os.path.abspath(path)
  while os.path.commonprefix([thisPath, absBuildRoot]) == absBuildRoot:

    try:
      # test: did we already parse this one?
      allIgnoreFiles[thisPath]
    except KeyError:
      # nope; parse it and add to the map.
      allIgnoreFiles[thisPath] = MMIgnore(thisPath)

    # go up one level.
    thisPath = os.path.abspath(thisPath + os.sep + "..")
Exemplo n.º 2
0
  def epilogue(self):
    """ Return the text which is our script footer """
    # TODO(aaron): This should use optparse.
    return """

os.chdir(\"""" + paths.getBuildRoot() + """\")