Rizin
unix-like reverse engineering framework and cli tools
meson_git_wrapper Namespace Reference

Functions

def isCArgSupported (executable, path)
 
def simple_git_execution (args)
 
def parse ()
 
def main ()
 

Function Documentation

◆ isCArgSupported()

def meson_git_wrapper.isCArgSupported (   executable,
  path 
)

Definition at line 13 of file meson_git_wrapper.py.

13 def isCArgSupported(executable, path):
14  try:
15  subprocess.run(
16  [executable, "-C", path, "status"],
17  stdout=subprocess.PIPE,
18  stderr=subprocess.PIPE,
19  check=True,
20  )
21  return True
22  except subprocess.CalledProcessError:
23  return False
24 
25 
def isCArgSupported(executable, path)

Referenced by main().

◆ main()

def meson_git_wrapper.main ( void  )

Definition at line 50 of file meson_git_wrapper.py.

50 def main():
51  git_exe, repo_path, args = parse()
52 
53  if isCArgSupported(git_exe, repo_path):
54  simple_git_execution([git_exe, "-C", repo_path] + args)
55  else:
56  os.chdir(repo_path)
57  simple_git_execution([git_exe] + args)
58 
59 
def simple_git_execution(args)
Definition: regcomp.c:57

References isCArgSupported(), and simple_git_execution().

◆ parse()

def meson_git_wrapper.parse ( )

Definition at line 34 of file meson_git_wrapper.py.

34 def parse():
35  if len(sys.argv) <= 3:
36  print(
37  "Usage: {} <git_executable_path> <repo_path> [git_args...]".format(
38  sys.argv[0]
39  )
40  )
41  sys.exit(1)
42 
43  git_exe = sys.argv[1]
44  repo_path = sys.argv[2]
45  args = sys.argv[3:]
46 
47  return git_exe, repo_path, args
48 
49 
size_t len
Definition: 6502dis.c:15

References len.

◆ simple_git_execution()

def meson_git_wrapper.simple_git_execution (   args)

Definition at line 26 of file meson_git_wrapper.py.

26 def simple_git_execution(args):
27  try:
28  called = subprocess.run(args, check=True)
29  sys.exit(called.returncode)
30  except subprocess.CalledProcessError as e:
31  sys.exit(e.returncode)
32 
33 

Referenced by main().