Browse Source

ruby: Use $PREFIX/bin/sh instead of /system/bin/sh

android-5
Fredrik Fornwall 9 years ago
parent
commit
2fd1858183
  1. 12
      packages/ruby/process.c.patch
  2. 2
      packages/ruby/pty.c.patch

12
packages/ruby/process.c.patch

@ -6,10 +6,10 @@ diff -u -r ../ruby-2.1.2/process.c ./process.c
*--argv = (char *)"sh"; *--argv = (char *)"sh";
if (envp) if (envp)
- execve("/bin/sh", argv, envp); /* async-signal-safe */ - execve("/bin/sh", argv, envp); /* async-signal-safe */
+ execve("/system/bin/sh", argv, envp); /* async-signal-safe */ + execve("@TERMUX_PREFIX@/bin/sh", argv, envp); /* async-signal-safe */
else else
- execv("/bin/sh", argv); /* async-signal-safe */ - execv("/bin/sh", argv); /* async-signal-safe */
+ execv("/system/bin/sh", argv); /* async-signal-safe */ + execv("@TERMUX_PREFIX@/bin/sh", argv); /* async-signal-safe */
} }
#else #else
@ -18,10 +18,10 @@ diff -u -r ../ruby-2.1.2/process.c ./process.c
#else #else
if (envp_str) if (envp_str)
- execle("/bin/sh", "sh", "-c", str, (char *)NULL, (char **)RSTRING_PTR(envp_str)); /* async-signal-safe */ - execle("/bin/sh", "sh", "-c", str, (char *)NULL, (char **)RSTRING_PTR(envp_str)); /* async-signal-safe */
+ execle("/system/bin/sh", "sh", "-c", str, (char *)NULL, (char **)RSTRING_PTR(envp_str)); /* async-signal-safe */ + execle("@TERMUX_PREFIX@/bin/sh", "sh", "-c", str, (char *)NULL, (char **)RSTRING_PTR(envp_str)); /* async-signal-safe */
else else
- execl("/bin/sh", "sh", "-c", str, (char *)NULL); /* async-signal-safe */ - execl("/bin/sh", "sh", "-c", str, (char *)NULL); /* async-signal-safe */
+ execl("/system/bin/sh", "sh", "-c", str, (char *)NULL); /* async-signal-safe */ + execl("@TERMUX_PREFIX@/bin/sh", "sh", "-c", str, (char *)NULL); /* async-signal-safe */
#endif #endif
return -1; return -1;
#endif /* _WIN32 */ #endif /* _WIN32 */
@ -30,7 +30,7 @@ diff -u -r ../ruby-2.1.2/process.c ./process.c
*argv = (char *)prog; *argv = (char *)prog;
*--argv = (char *)"sh"; *--argv = (char *)"sh";
- status = spawnv(P_NOWAIT, "/bin/sh", (const char **)argv); - status = spawnv(P_NOWAIT, "/bin/sh", (const char **)argv);
+ status = spawnv(P_NOWAIT, "/system/bin/sh", (const char **)argv); + status = spawnv(P_NOWAIT, "@TERMUX_PREFIX@/bin/sh", (const char **)argv);
after_exec(); after_exec();
if (status == -1) errno = ENOEXEC; if (status == -1) errno = ENOEXEC;
} }
@ -39,7 +39,7 @@ diff -u -r ../ruby-2.1.2/process.c ./process.c
char *shell = dln_find_exe_r("sh", 0, fbuf, sizeof(fbuf)); char *shell = dln_find_exe_r("sh", 0, fbuf, sizeof(fbuf));
before_exec(); before_exec();
- status = spawnl(P_NOWAIT, (shell ? shell : "/bin/sh"), "sh", "-c", str, (char*)NULL); - status = spawnl(P_NOWAIT, (shell ? shell : "/bin/sh"), "sh", "-c", str, (char*)NULL);
+ status = spawnl(P_NOWAIT, (shell ? shell : "/system/bin/sh"), "sh", "-c", str, (char*)NULL); + status = spawnl(P_NOWAIT, (shell ? shell : "@TERMUX_PREFIX@/bin/sh"), "sh", "-c", str, (char*)NULL);
after_exec(); after_exec();
return status; return status;
} }

2
packages/ruby/pty.c.patch

@ -6,7 +6,7 @@ diff -u -r ../ruby-2.1.2/ext/pty/pty.c ./ext/pty/pty.c
shellname = pwent->pw_shell; shellname = pwent->pw_shell;
else else
- shellname = "/bin/sh"; - shellname = "/bin/sh";
+ shellname = "/system/bin/sh"; + shellname = "@TERMUX_PREFIX@/bin/sh";
} }
v = rb_str_new2(shellname); v = rb_str_new2(shellname);
argc = 1; argc = 1;

Loading…
Cancel
Save