From e6dfaa312e02b25ab4b80a7a1a7af3958e7b3863 Mon Sep 17 00:00:00 2001 From: Andrey Lushnikov Date: Mon, 24 Apr 2023 21:26:36 +0000 Subject: [PATCH] chore: roll browser patches from upstream repository (#22608) --- browser_patches/roll_from_upstream.sh | 44 +++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100755 browser_patches/roll_from_upstream.sh diff --git a/browser_patches/roll_from_upstream.sh b/browser_patches/roll_from_upstream.sh new file mode 100755 index 0000000000..45f3f53832 --- /dev/null +++ b/browser_patches/roll_from_upstream.sh @@ -0,0 +1,44 @@ +#!/bin/bash +# A script to roll browser patches from internal repository. + +set -e +set +x + +trap "cd $(pwd -P)" EXIT +cd "$(dirname "$0")" + +SCRIPT_PATH=$(pwd -P) + +if [[ "$#" -ne 1 ]]; then + echo "Usage: $0 " + exit 1 +fi + +SOURCE_DIRECTORY="$1" + +if [[ $(basename "${SOURCE_DIRECTORY}") != "playwright-browsers" ]]; then + echo "ERROR: the source directory must be named 'playwright-browsers'" + exit 1 +fi + +if ! [[ -d "${SOURCE_DIRECTORY}/browser_patches" ]]; then + echo "ERROR: the ${SOURCE_DIRECTORY}/browser_patches does not exist" + exit 1 +fi + +files=( + "./firefox/juggler/" + "./firefox/patches/" + "./firefox/preferences/" + "./firefox/UPSTREAM_CONFIG.sh" + "./webkit/embedder/" + "./webkit/patches/" + "./webkit/pw_run.sh" + "./webkit/UPSTREAM_CONFIG.sh" + "./winldd/" +) + +for file in "${files[@]}"; do + rsync -av --delete "${SOURCE_DIRECTORY}/browser_patches/${file}" "${SCRIPT_PATH}/${file}" +done +