MCPcopy Index your code
hub / github.com/cirosantilli/linux-kernel-module-cheat / resolve_executable

Method resolve_executable

common.py:995–1011  ·  view source on GitHub ↗
(self, in_path, magic_in_dir, magic_out_dir, out_ext)

Source from the content-addressed store, hash-verified

993 return argcopy
994
995 def resolve_executable(self, in_path, magic_in_dir, magic_out_dir, out_ext):
996 if os.path.isabs(in_path):
997 return in_path
998 else:
999 paths = [
1000 os.path.join(magic_out_dir, in_path),
1001 os.path.join(
1002 magic_out_dir,
1003 os.path.relpath(in_path, magic_in_dir),
1004 )
1005 ]
1006 paths[:] = [os.path.splitext(path)[0] + out_ext for path in paths]
1007 for path in paths:
1008 if os.path.exists(path):
1009 return path
1010 if not self.env['dry_run']:
1011 raise Exception('Executable file not found. Tried:\n' + '\n'.join(paths))
1012
1013 def resolve_userland(self, path):
1014 return self.resolve_executable(

Callers 2

_init_envMethod · 0.95
resolve_userlandMethod · 0.95

Calls 1

joinMethod · 0.80

Tested by

no test coverage detected