• rbpotter's avatar
    Web UI: Update unpack_pak to detect files outside the directory · edee5078
    rbpotter authored
    - Add pak_base_dir option to map generated files based on a root
    directory other than the directory where the pak file is located.
    This is the case for the os settings build, where the pak file is
    under gen/c/b/r/settings/chromeos, but paths should be based on
    gen/c/b/r/settings.
    - Add exclude option to exclude certain files from being unpacked.
    This is to allow UIs like the NTP, downloads, and OS settings to
    keep files that should not be created by unpack_pak in their grd files.
    - Add an assert, ensure unpack_pak.py never creates files/directories
    outside of the unpak folder in future. Creating these directories can
    cause post-CQ build failures due to race conditions, as seen in the
    linked bug.
    
    Bug: 1093405
    Change-Id: If85ea9f08c4dbe008ec16ca0a457390012833c56
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2251050Reviewed-by: default avatarKyle Horimoto <khorimoto@chromium.org>
    Reviewed-by: default avatardpapad <dpapad@chromium.org>
    Commit-Queue: Rebekah Potter <rbpotter@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#780364}
    edee5078
unpack_pak_test.py 1005 Bytes