Skip to content

Commit 6c5b72d

Browse files
authored
Remove extra code signature calculation (#468)
1 parent be3a5bf commit 6c5b72d

1 file changed

Lines changed: 2 additions & 22 deletions

File tree

src/launchpad/size/utils/apple_bundle_size.py

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
import lzfse
1010

11-
from launchpad.parsers.apple.macho_parser import MachOParser
1211
from launchpad.size.constants import APPLE_FILESYSTEM_BLOCK_SIZE
1312
from launchpad.utils.file_utils import get_file_size, to_nearest_block_size
1413
from launchpad.utils.logging import get_logger
@@ -28,14 +27,12 @@ def calculate_bundle_sizes(bundle_url: Path) -> Tuple[int, int]:
2827
install_size = _calculate_app_store_size(bundle_url)
2928
metadata_size = _zip_metadata_size_for_bundle(bundle_url)
3029
lzfse_size = _lzfse_content_size_for_bundle(bundle_url)
31-
signature_size = _get_extra_code_signature_size(bundle_url)
32-
download_size = metadata_size + lzfse_size + signature_size
30+
download_size = metadata_size + lzfse_size
3331

3432
logger.debug(
3533
f"Bundle size breakdown - "
3634
f"ZIP metadata: {metadata_size} bytes, "
3735
f"LZFSE content: {lzfse_size} bytes, "
38-
f"Code signature: {signature_size} bytes, "
3936
f"Total download: {download_size} bytes, "
4037
f"Total install: {install_size} bytes"
4138
)
@@ -54,17 +51,7 @@ def _calculate_app_store_size(bundle_url: Path) -> int:
5451
continue
5552

5653
file_count += 1
57-
58-
if file_path.is_file():
59-
file_size = to_nearest_block_size(get_file_size(file_path), APPLE_FILESYSTEM_BLOCK_SIZE)
60-
61-
# Add extra code signature size for binaries without extensions
62-
if not file_path.suffix and MachOParser.is_macho_binary(file_path):
63-
file_size += _get_extra_code_signature_size(file_path)
64-
65-
else:
66-
# Add directory size, they take up a little space for metadata
67-
file_size = to_nearest_block_size(get_file_size(file_path), APPLE_FILESYSTEM_BLOCK_SIZE)
54+
file_size = to_nearest_block_size(get_file_size(file_path), APPLE_FILESYSTEM_BLOCK_SIZE)
6855

6956
total_size += file_size
7057
logger.debug(f"File size: {file_size}, Total size: {total_size}")
@@ -181,10 +168,3 @@ def _zip_metadata_size_for_bundle(bundle_url: Path) -> int:
181168
zip_file_path.unlink()
182169
if zip_info_file_path.exists():
183170
zip_info_file_path.unlink()
184-
185-
186-
def _get_extra_code_signature_size(bundle_url: Path) -> int:
187-
"""Calculate additional space needed for code signature."""
188-
189-
# TODO(EME-433): Implement actual code signature size calculation
190-
return 0

0 commit comments

Comments
 (0)