def METHOD_NAME(argv):
  """Returns an exit code."""
  # Set an environment variable so dependencies in debug mode can be excluded.
  posix.environ['_OVM_DEPS'] = '1'
  action = argv[1]
  main_module = argv[2]
  log('Before importing: %d modules', len(OLD_MODULES))
  if action == 'both':  # Write files for both .py and .so dependencies
    prefix = argv[3]
    py_out_path = prefix + '-cpython.txt'
    c_out_path = prefix + '-c.txt'
    modules = ImportMain(main_module, OLD_MODULES)
    with open(py_out_path, 'w') as py_out, open(c_out_path, 'w') as c_out:
      for mod_type, x, y in FilterModules(modules):
        if mod_type == PY_MODULE:
          print(x, y, file=py_out)
          print(x + 'c', y + 'c', file=py_out)  # .pyc goes in bytecode.zip too
        elif mod_type == C_MODULE:
          print(x, y, file=c_out)  # mod_name, full_path
        else:
          raise AssertionError(mod_type)
  elif action == 'py':  # .py path -> .pyc relative path
    modules = ImportMain(main_module, OLD_MODULES)
    for mod_type, full_path, rel_path in FilterModules(modules):
      if mod_type == PY_MODULE:
        opy_input = full_path
        opy_output = rel_path + 'c'  # output is .pyc
        print(opy_input, opy_output)
  elif action == 'py-manifest':  # .py path -> .py relative path
    modules = ImportMain(main_module, OLD_MODULES)
    for mod_type, full_path, rel_path in FilterModules(modules):
      if mod_type == PY_MODULE:
        opy_input = full_path
        assert rel_path.endswith('.py')
        #mod_name = rel_path[:-3].replace('/', '.')
        print(opy_input, rel_path)
  else:
    raise RuntimeError('Invalid action %r' % action)