Merge "Add the primary file to EXTRA_INSTALL_ZIPS" into main

This commit is contained in:
Treehugger Robot
2024-05-13 22:56:45 +00:00
committed by Gerrit Code Review
2 changed files with 7 additions and 4 deletions

View File

@@ -507,7 +507,7 @@ EXTRA_INSTALL_ZIPS :=
if extraFiles := install.extraFiles; extraFiles != nil {
fmt.Fprintf(buf, "\t( unzip -qDD -d '%s' '%s' 2>&1 | grep -v \"zipfile is empty\"; exit $${PIPESTATUS[0]} ) || \\\n", extraFiles.dir.String(), extraFiles.zip.String())
fmt.Fprintf(buf, "\t ( code=$$?; if [ $$code -ne 0 -a $$code -ne 1 ]; then exit $$code; fi )\n")
fmt.Fprintf(buf, "EXTRA_INSTALL_ZIPS += %s:%s\n", extraFiles.dir.String(), extraFiles.zip.String())
fmt.Fprintf(buf, "EXTRA_INSTALL_ZIPS += %s:%s:%s\n", install.to.String(), extraFiles.dir.String(), extraFiles.zip.String())
}
fmt.Fprintln(buf)

View File

@@ -18,13 +18,16 @@ def main():
parser.add_argument('staging_dir',
help='Path to the partition staging directory')
parser.add_argument('extra_install_zips', nargs='*',
help='The value of EXTRA_INSTALL_ZIPS from make. It should be a list of extraction_dir:zip_file pairs.')
help='The value of EXTRA_INSTALL_ZIPS from make. '
'It should be a list of primary_file:extraction_dir:zip_file trios. '
'The primary file will be ignored by this script, you should ensure that '
'the list of trios given to this script is already filtered by relevant primary files.')
args = parser.parse_args()
staging_dir = args.staging_dir.removesuffix('/') + '/'
for zip_pair in args.extra_install_zips:
d, z = zip_pair.split(':')
for zip_trio in args.extra_install_zips:
_, d, z = zip_trio.split(':')
d = d.removesuffix('/') + '/'
if d.startswith(staging_dir):