summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTreehugger Robot <treehugger-gerrit@google.com>2019-01-24 02:47:06 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2019-01-24 02:47:06 +0000
commit1e287fa6d57baa3a83583b35d907ad4ccd776d1a (patch)
treedb748876639346c2721703741959818146dd06ca
parent06c57d0ecf8d5e1a9bf00ba8729ca42b5cdb5737 (diff)
parentb59da8f6185c00fdcb936a9b67cbc98f0cb5c158 (diff)
downloaddevelopment-1e287fa6d57baa3a83583b35d907ad4ccd776d1a.tar.gz
Merge "vndk-snapshot: add version suffix for v27 files"
-rw-r--r--vndk/snapshot/gen_buildfiles.py9
-rw-r--r--vndk/snapshot/update.py19
2 files changed, 21 insertions, 7 deletions
diff --git a/vndk/snapshot/gen_buildfiles.py b/vndk/snapshot/gen_buildfiles.py
index 9a8d4de1b..f504f552e 100644
--- a/vndk/snapshot/gen_buildfiles.py
+++ b/vndk/snapshot/gen_buildfiles.py
@@ -129,11 +129,10 @@ class GenBuildFile(object):
self._vndk_version))
etc_buildrules = []
for prebuilt in self.ETC_MODULES:
- # Starting from P (VNDK version >= 28), ld.config.VER.txt is not
- # installed as a prebuilt but is built and installed from the
- # source tree at the time the VNDK snapshot is installed to the
- # system.img.
- if prebuilt == 'ld.config.txt' and self._vndk_version >= 28:
+ # ld.config.VER.txt is not installed as a prebuilt but is built and
+ # installed from thesource tree at the time the VNDK snapshot is
+ # installed to the system.img.
+ if prebuilt == 'ld.config.txt':
continue
etc_buildrules.append(self._gen_etc_prebuilt(prebuilt))
diff --git a/vndk/snapshot/update.py b/vndk/snapshot/update.py
index d15cf0464..2a8441ed9 100644
--- a/vndk/snapshot/update.py
+++ b/vndk/snapshot/update.py
@@ -115,8 +115,10 @@ def gather_notice_files(install_dir):
shutil.rmtree(notices_dir_per_arch)
-def revise_ld_config_txt_if_needed(vndk_version):
+def post_processe_files_if_needed(vndk_version):
"""For O-MR1, replaces unversioned VNDK directories with versioned ones.
+ Also, renames ld.config.txt, llndk.libraries.txt and vndksp.libraries.txt
+ files to have version suffix.
Unversioned VNDK directories: /system/${LIB}/vndk[-sp]
Versioned VNDK directories: /system/${LIB}/vndk[-sp]-27
@@ -124,6 +126,13 @@ def revise_ld_config_txt_if_needed(vndk_version):
Args:
vndk_version: int, version of VNDK snapshot
"""
+ def add_version_suffix(file_name):
+ logging.info('Rename {} to have version suffix'.format(vndk_version))
+ target_files = glob.glob(
+ os.path.join(utils.CONFIG_DIR_PATH_PATTERN, file_name))
+ for target_file in target_files:
+ name, ext = os.path.splitext(target_file)
+ os.rename(target_file, name + '.' + str(vndk_version) + ext)
if vndk_version == 27:
logging.info('Revising ld.config.txt for O-MR1...')
re_pattern = '(system\/\${LIB}\/vndk(?:-sp)?)([:/]|$)'
@@ -136,6 +145,12 @@ def revise_ld_config_txt_if_needed(vndk_version):
with open(ld_config_file, 'w') as file:
file.write(revised)
+ files_to_add_version_suffix = ('ld.config.txt',
+ 'llndk.libraries.txt',
+ 'vndksp.libraries.txt')
+ for file_to_rename in files_to_add_version_suffix:
+ add_version_suffix(file_to_rename)
+
def update_buildfiles(buildfile_generator):
logging.info('Generating root Android.bp file...')
@@ -248,7 +263,7 @@ def main():
install_snapshot(args.branch, args.build, local, install_dir,
temp_artifact_dir)
gather_notice_files(install_dir)
- revise_ld_config_txt_if_needed(vndk_version)
+ post_processe_files_if_needed(vndk_version)
buildfile_generator = GenBuildFile(install_dir, vndk_version)
update_buildfiles(buildfile_generator)