Fix path to add3prf.py when calling from get_rust_pkg.py

When --add3prf is set, `get_rust_pkg.py` script `cd` into the crate directory and run `add3prf.py`. However, `add3prf.py` doesn't exist in the newly downloaded crate directory. This CL ensures that we reference to the existing `add3prf.py` script.

Test: development/scripts/get_rust_pkg.py -add3prf -v -o /tmp tinyjson-2.5.1
Change-Id: I4273d4f2b6a1f353960adbbab9abbb96bf3e68f3
This commit is contained in:
Vinh Tran
2023-08-18 10:21:56 -04:00
parent 4bed088780
commit 46e085a961

View File

@@ -168,11 +168,11 @@ def fetch_pkg(args, pkg, dl_path):
echo(args, "Calling add3prf.py in {}".format(dest_dir))
cwd = os.getcwd()
os.chdir(dest_dir)
os.system("add3prf.py")
# add3prf.py is in the same directory as this python script
os.system(os.path.dirname(__file__) + "/add3prf.py")
os.chdir(cwd)
return True
def get_crate_dependencies(args, pkg):
"""Ask crates.io for pkg's dependencies."""
echo(args, "Ask crates.io for {} ...".format(pkg))