diff options
author | Mitchell Wills <mwills@google.com> | 2019-12-06 17:22:43 -0800 |
---|---|---|
committer | Mitchell Wills <mwills@google.com> | 2019-12-06 19:13:21 -0800 |
commit | a428b092e6c4c687647a2d17d35324105f2889b1 (patch) | |
tree | 7d6132e8cb96eaceff69a6be724797ef17443669 /tools/generate-self-extracting-archive.py | |
parent | 0c4f577f1c580b8d406d0f56fdfde77288f8a1ad (diff) |
Fix comment to reflect that the value passed to head is actually the size
There is no functional change
Bug: 130257221
Test: generated an archive using the script and ran the result
Change-Id: I946f2827a9519873be2173fc50d9bc1cc46a326f
Diffstat (limited to 'tools/generate-self-extracting-archive.py')
-rwxr-xr-x | tools/generate-self-extracting-archive.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/tools/generate-self-extracting-archive.py b/tools/generate-self-extracting-archive.py index f1bade3c86..5b0628da88 100755 --- a/tools/generate-self-extracting-archive.py +++ b/tools/generate-self-extracting-archive.py @@ -92,7 +92,7 @@ def _pipe_bytes(src, dst): dst.write(b) _MAX_OFFSET_WIDTH = 20 -def _generate_extract_command(start, end, extract_name): +def _generate_extract_command(start, size, extract_name): """Generate the extract command. The length of this string must be constant no matter what the start and end @@ -101,7 +101,7 @@ def _generate_extract_command(start, end, extract_name): Args: start: offset in bytes of the start of the wrapped file - end: offset in bytes of the end of the wrapped file + size: size in bytes of the wrapped file extract_name: of the file to create when extracted """ @@ -111,11 +111,11 @@ def _generate_extract_command(start, end, extract_name): if len(start_str) != _MAX_OFFSET_WIDTH + 1: raise Exception('Start offset too large (%d)' % start) - end_str = ('%d' % end).rjust(_MAX_OFFSET_WIDTH) - if len(end_str) != _MAX_OFFSET_WIDTH: - raise Exception('End offset too large (%d)' % end) + size_str = ('%d' % size).rjust(_MAX_OFFSET_WIDTH) + if len(size_str) != _MAX_OFFSET_WIDTH: + raise Exception('Size too large (%d)' % size) - return "tail -c %s $0 | head -c %s > %s\n" % (start_str, end_str, extract_name) + return "tail -c %s $0 | head -c %s > %s\n" % (start_str, size_str, extract_name) def main(argv): |