BASH CODE:
source /proj/common/tools/repo/etc/profile.d/repo.sh
repo project init $branch
repo project sync
source poky/fnc-init-build-env build
bitbake -g $image
I converted this bash code into python(version 2.7). While executing my python code, I am getting repo command not found message.
PYTHON CODE:
os.system("source /proj/common/tools/repo/etc/profile.d/repo.sh")
os.system("repo project init " + branch)
os.system("repo project sync")
os.system("source poky/fnc-init-build-env build")
os.chdir("poky/build")
os.system("bitbake -g " + image)
ERROR MESSAGE:
sh: repo: command not found
sh: repo: command not found
I tried with subprocess.call(), I am getting the same error message.
os.systemcall invokes a unique shell. Theos.system("source ...command had no effect on the next shell used withos.system(" repo .... Generally, you won't have luck here unless you reimplementrepo.shalso.os.systemwith the original source code, unless absolutely necessary. As in, no library exists to do this in Python, and writing one would be prohibitively expensive.