mirror of
https://github.com/radareorg/r2env.git
synced 2026-11-08 17:42:22 -10:00
Compare commits
6
Commits
fix-ci
...
fix-termux
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0af796baa0 | ||
|
|
f64c5d8dd3 | ||
|
|
0f4197ef60 | ||
|
|
9dcd499400 | ||
|
|
7513c6d1b6 | ||
|
|
f097dbb7c5 |
No files matched your search
+8
-2
@@ -90,8 +90,14 @@ class R2Env:
|
||||
with open("version.txt", "r") as version:
|
||||
return version.read()
|
||||
|
||||
def shell(self):
|
||||
pass
|
||||
def shell(self, cmd=""):
|
||||
line = "export PS1=\"r2env\\$ \";export PATH=\"" + self._r2env_path + "/bin:$PATH\"; $SHELL -f"
|
||||
if os.path.isfile("/default.prop"): # hack for pre-dtag builds of r2
|
||||
line = "export LD_LIBRARY_PATH=\"" + self._r2env_path + "/lib\";" + line
|
||||
if cmd.strip() == "":
|
||||
return os.system(line)
|
||||
print(os.system(line + " -c '" + cmd + "'"))
|
||||
return os.system(line + " -c '" + cmd + "'")
|
||||
|
||||
@staticmethod
|
||||
def _load_config():
|
||||
|
||||
@@ -94,9 +94,13 @@ class PackageManager:
|
||||
def _build_using_acr(source_path, dst_path, logfile):
|
||||
"""Only works in Unix systems"""
|
||||
exit_if_not_exists(['make'])
|
||||
print_console("[-] Building package using acr ...")
|
||||
cmd = "(cd {0} && rm -rf shlr/capstone && ./configure --with-rpath --prefix={1} 2>&1 && make -j4 2>&1" \
|
||||
"&& make install) > {2}".format(source_path, dst_path, logfile)
|
||||
print_console("[-] Building package using acr for Termux...")
|
||||
extra_flags = ""
|
||||
if os.path.isfile("/default.prop"):
|
||||
extra_flags = " --with-compiler=termux"
|
||||
cmd = "(cd {0} && rm -rf shlr/capstone && ./configure {1}" \
|
||||
" --with-rpath --prefix={2} 2>&1 && make -j4 2>&1" \
|
||||
"&& make install) > {3}".format(source_path, extra_flags, dst_path, logfile)
|
||||
return os.system(cmd) == 0
|
||||
|
||||
@staticmethod
|
||||
|
||||
+6
-3
@@ -28,13 +28,15 @@ def show_help():
|
||||
print_console(HELP_MESSAGE)
|
||||
|
||||
|
||||
actions_with_argument = ["install", "uninstall"]
|
||||
actions_with_argument = ["install", "uninstall", "use"]
|
||||
actions_with_arguments = ["shell"]
|
||||
actions = {
|
||||
"init": R2Env().init,
|
||||
"version": R2Env().get_r2_path,
|
||||
"config": R2Env().show_config,
|
||||
"list": R2Env().list_available_packages,
|
||||
"install": R2Env().install,
|
||||
"shell": R2Env().shell,
|
||||
"uninstall": R2Env().uninstall,
|
||||
"use": R2Env().use,
|
||||
"versions": R2Env().list_installed_packages,
|
||||
@@ -45,8 +47,9 @@ actions = {
|
||||
def run_action(action, args, use_meson):
|
||||
if action not in actions:
|
||||
print_console("[X] Action not found", ERROR)
|
||||
return
|
||||
if action in actions_with_argument:
|
||||
elif action in actions_with_arguments:
|
||||
actions[action](" ".join(args))
|
||||
elif action in actions_with_argument:
|
||||
exit_if_not_argument_is_set(args, action)
|
||||
if action == "install":
|
||||
actions[action](args[0], use_meson=use_meson)
|
||||
|
||||
Reference in new issue
Block a user