From 46e085a9612f7a82cc28198ad0c51f1eeb8cfa60 Mon Sep 17 00:00:00 2001 From: Vinh Tran Date: Fri, 18 Aug 2023 10:21:56 -0400 Subject: [PATCH] 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 --- scripts/get_rust_pkg.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/get_rust_pkg.py b/scripts/get_rust_pkg.py index a1fc8bf9f..e9082fe05 100755 --- a/scripts/get_rust_pkg.py +++ b/scripts/get_rust_pkg.py @@ -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))