mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
tools/build/make.py: fix cross build on Fedora Linux
Fedora defines shell functions for some commands used by FreeBSD build
scripts. Unortunatelly it makes them behave incorrectly for our purposes.
For instance 'which which' returns something like:
which ()
{
( alias;
eval ${which_declare} ) | /usr/bin/which --tty-only --read-alias ...
}
instead of
/usr/bin/which
This patch unsets those functions to restore original/expected behavior
Reviewed by: emaste, imp
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D36900
This commit is contained in:
parent
4d447b30f7
commit
b7ac17b48b
1 changed files with 8 additions and 0 deletions
|
|
@ -267,5 +267,13 @@ if __name__ == "__main__":
|
|||
shlex.quote(s) for s in [str(bmake_binary)] + bmake_args)
|
||||
debug("Running `env ", env_cmd_str, " ", make_cmd_str, "`", sep="")
|
||||
os.environ.update(new_env_vars)
|
||||
|
||||
# Fedora defines bash function wrapper for some shell commands and this
|
||||
# makes 'which <command>' return the function's source code instead of
|
||||
# the binary path. Undefine it to restore the original behavior.
|
||||
os.unsetenv("BASH_FUNC_which%%")
|
||||
os.unsetenv("BASH_FUNC_ml%%")
|
||||
os.unsetenv("BASH_FUNC_module%%")
|
||||
|
||||
os.chdir(str(source_root))
|
||||
os.execv(str(bmake_binary), [str(bmake_binary)] + bmake_args)
|
||||
|
|
|
|||
Loading…
Reference in a new issue