devops: fix chromium archiving with FILES.cfg (#6450)

- unset `IFS` variable so that it doesn't affect future script execution
- use `\n\r` separator on windows
- fix script to be Python2/Python3 compliant
This commit is contained in:
Andrey Lushnikov 2021-05-06 13:55:55 -07:00 committed by GitHub
parent 45d92890af
commit 262824deb7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 5 deletions

View File

@ -59,12 +59,15 @@ function archive_compiled_chromium() {
CHROMIUM_FOLDER_NAME="chrome-linux"
# Run python script and convert output to array.
IFS=$'\n' CHROMIUM_FILES_TO_ARCHIVE=($("${SCRIPT_PATH}/compute_files_to_archive.py" 64bit "${CR_CHECKOUT_PATH}/src/chrome/tools/build/linux/FILES.cfg"))
unset IFS
elif [[ $1 == "--compile-win32" ]]; then
CHROMIUM_FOLDER_NAME="chrome-win"
IFS=$'\n' CHROMIUM_FILES_TO_ARCHIVE=($("${SCRIPT_PATH}/compute_files_to_archive.py" 32bit "${CR_CHECKOUT_PATH}/src/chrome/tools/build/win/FILES.cfg"))
IFS=$'\n\r' CHROMIUM_FILES_TO_ARCHIVE=($("${SCRIPT_PATH}/compute_files_to_archive.py" 32bit "${CR_CHECKOUT_PATH}/src/chrome/tools/build/win/FILES.cfg"))
unset IFS
elif [[ $1 == "--compile-win64" ]]; then
CHROMIUM_FOLDER_NAME="chrome-win"
IFS=$'\n' CHROMIUM_FILES_TO_ARCHIVE=($("${SCRIPT_PATH}/compute_files_to_archive.py" 64bit "${CR_CHECKOUT_PATH}/src/chrome/tools/build/win/FILES.cfg"))
IFS=$'\n\r' CHROMIUM_FILES_TO_ARCHIVE=($("${SCRIPT_PATH}/compute_files_to_archive.py" 64bit "${CR_CHECKOUT_PATH}/src/chrome/tools/build/win/FILES.cfg"))
unset IFS
else
echo "ERROR: unknown command, use --help for details"
exit 1

View File

@ -4,15 +4,15 @@ import sys
import json
if len(sys.argv) < 2:
print "ERROR: expected arch: 32bit or 64bit"
print("ERROR: expected arch: 32bit or 64bit")
sys.exit(1)
if str(sys.argv[1]) == "--help" or str(sys.argv[1]) == "-h":
print "Usage: read_files.py [32bit|64bit] <files.cfg path>"
print("Usage: read_files.py [32bit|64bit] <files.cfg path>")
sys.exit(1)
if len(sys.argv) < 3:
print "ERROR: expected FILE.cfg path"
print("ERROR: expected FILE.cfg path")
sys.exit(1)
exclude_list = [