def read_manifest(path):
  """Reads the given runfiles manifest."""
  with open(path, 'r') as f:
    entries = {}
    for line in f.readlines():
      components = line.strip().split(' ')
      runfile = components[0]
      if len(components) == 1:
        actual = None
      elif len(components) == 2:
        actual = components[1]
      else:
        raise Exception("unexpected components: %s" % components)
      entries[runfile] = actual
    return entries