Example #1
0
def ReadConfig():
    # Mock out ReadConfig if running unittests.  Settings are applied directly
    # by DriverTestEnv rather than reading this configuration file.
    if env.has('PNACL_RUNNING_UNITTESTS'):
        return
    driver_bin = env.getone('DRIVER_BIN')
    driver_conf = pathtools.join(driver_bin, 'driver.conf')
    fp = DriverOpen(driver_conf, 'r')
    linecount = 0
    for line in fp:
        linecount += 1
        line = line.strip()
        if line == '' or line.startswith('#'):
            continue
        sep = line.find('=')
        if sep < 0:
            Log.Fatal("%s: Parse error, missing '=' on line %d",
                      pathtools.touser(driver_conf), linecount)
        keyname = line[:sep].strip()
        value = line[sep + 1:].strip()
        env.setraw(keyname, value)
    DriverClose(fp)

    if env.getone('LIBMODE') not in ('newlib', 'glibc'):
        Log.Fatal('Invalid LIBMODE in %s', pathtools.touser(driver_conf))
Example #2
0
def ReadConfig():
  # Mock out ReadConfig if running unittests.  Settings are applied directly
  # by DriverTestEnv rather than reading this configuration file.
  if env.has('PNACL_RUNNING_UNITTESTS'):
    return
  driver_bin = env.getone('DRIVER_BIN')
  driver_conf = pathtools.join(driver_bin, 'driver.conf')
  fp = DriverOpen(driver_conf, 'r')
  linecount = 0
  for line in fp:
    linecount += 1
    line = line.strip()
    if line == '' or line.startswith('#'):
      continue
    sep = line.find('=')
    if sep < 0:
      Log.Fatal("%s: Parse error, missing '=' on line %d",
                pathtools.touser(driver_conf), linecount)
    keyname = line[:sep].strip()
    value = line[sep+1:].strip()
    env.setraw(keyname, value)
  DriverClose(fp)

  if env.getone('LIBMODE') not in ('newlib', 'glibc'):
    Log.Fatal('Invalid LIBMODE in %s', pathtools.touser(driver_conf))
Example #3
0
def ReadConfig():
  driver_bin = env.getone('DRIVER_BIN')
  driver_conf = pathtools.join(driver_bin, 'driver.conf')
  fp = DriverOpen(driver_conf, 'r')
  linecount = 0
  for line in fp:
    linecount += 1
    line = line.strip()
    if line == '' or line.startswith('#'):
      continue
    sep = line.find('=')
    if sep < 0:
      Log.Fatal("%s: Parse error, missing '=' on line %d",
                pathtools.touser(driver_conf), linecount)
    keyname = line[:sep].strip()
    value = line[sep+1:].strip()
    env.setraw(keyname, value)
  DriverClose(fp)

  if env.getone('LIBMODE') not in ('newlib', 'glibc'):
    Log.Fatal('Invalid LIBMODE in %s', pathtools.touser(driver_conf))