aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Albert <danalbert@google.com>2020-04-20 16:16:55 -0700
committerDan Albert <danalbert@google.com>2020-04-20 16:38:47 -0700
commit523708bc4df11553ce13da93079c2275c8d07f2c (patch)
treed7d71d25e1dcd2ec854d70f3aa5de330f84f3d45
parent020ff3beba1461c2a75c61e971128547e9853825 (diff)
downloadndk-523708bc4df11553ce13da93079c2275c8d07f2c.tar.gz
Fix framework bundle zip.
I'd originally built `_make_zip_package` to make it impossible to avoid a single parent directory, but now we need multiple files in the root of the zip because that's what the signer expects. Test: unzip -l of the artifact, saw _codesign/volumename Bug: http://b/143105198 Change-Id: Ib3834ed95154749136d8d6a36abfd47bb9a8f252
-rwxr-xr-xndk/checkbuild.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/ndk/checkbuild.py b/ndk/checkbuild.py
index f24746dd2..521158423 100755
--- a/ndk/checkbuild.py
+++ b/ndk/checkbuild.py
@@ -113,7 +113,7 @@ def _make_tar_package(package_path: str, base_dir: str, path: str) -> str:
def _make_zip_package(package_path: str,
base_dir: str,
- path: str,
+ paths: List[str],
preserve_symlinks: bool = False) -> str:
"""Creates a zip package for distribution.
@@ -121,15 +121,16 @@ def _make_zip_package(package_path: str,
package_path: Path (without extension) to the output archive.
base_dir: Path to the directory from which to perform the packaging
(identical to tar's -C).
- path: Path to the directory to package.
+ paths: Paths to files and directories to package, relative to base_dir.
preserve_symlinks: Set to true to preserve symlinks in the zip file.
"""
cwd = os.getcwd()
package_path = os.path.realpath(package_path) + '.zip'
- args = ['zip', '-9qr', package_path, path]
+ args = ['zip', '-9qr', package_path]
if preserve_symlinks:
args.append('--symlinks')
+ args.extend(paths)
os.chdir(base_dir)
try:
subprocess.check_call(args)
@@ -254,7 +255,7 @@ def make_framework_bundle(zip_path: Path, ndk_dir: Path, build_number: str,
create_signer_metadata(package_dir)
_make_zip_package(str(zip_path),
str(package_dir),
- framework_directory_name,
+ os.listdir(package_dir),
preserve_symlinks=True)
@@ -282,7 +283,7 @@ def package_ndk(ndk_dir: str, out_dir: str, dist_dir: str, host_tag: str,
bundle_path = Path(dist_dir) / bundle_name
make_framework_bundle(bundle_path, Path(ndk_dir), build_number,
Path(out_dir))
- return _make_zip_package(package_path, base_dir, package_files)
+ return _make_zip_package(package_path, base_dir, [package_files])
def build_ndk_tests(out_dir: str, dist_dir: str,