From 2ff1e6fc78759e294592bc7a624f5ad7b23f8439 Mon Sep 17 00:00:00 2001 From: Rob Seymour Date: Thu, 3 Feb 2022 16:22:10 +0000 Subject: [PATCH] Add root directory when copying owner file. Owner file is copied after changing to the install directory. Capture the root directory before changing directory and add to copy_owners. Test: python3 development/vndk/snapshot/update.py .. Bug: 214089693 Change-Id: I82e79441bdec4638002a00aaeef4ec107b180427 --- vndk/snapshot/update.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/vndk/snapshot/update.py b/vndk/snapshot/update.py index 2d68c31b0..192e35200 100644 --- a/vndk/snapshot/update.py +++ b/vndk/snapshot/update.py @@ -165,9 +165,9 @@ def update_buildfiles(buildfile_generator): logging.info('Generating Android.bp files...') buildfile_generator.generate_android_bp() -def copy_owners(install_dir): +def copy_owners(root_dir, install_dir): path = os.path.dirname(__file__) - shutil.copy(os.path.join(path, 'OWNERS'), install_dir) + shutil.copy(os.path.join(root_dir, path, 'OWNERS'), install_dir) def check_gpl_license(license_checker): try: @@ -253,7 +253,7 @@ def main(): 'before installing new snapshot.'.format(ver=vndk_version)) utils.set_logging_config(args.verbose) - + root_dir = os.getcwd() os.chdir(install_dir) if not args.use_current_branch: @@ -275,7 +275,7 @@ def main(): buildfile_generator = GenBuildFile(install_dir, vndk_version) update_buildfiles(buildfile_generator) - copy_owners(install_dir) + copy_owners(root_dir, install_dir) if not local: license_checker = GPLChecker(install_dir, ANDROID_BUILD_TOP,