mirror of
https://github.com/Such-Software/adaptive-multi-protocol-browser.git
synced 2026-10-20 15:58:33 +02:00
Add AMPB browser source build spike tools
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
#!/bin/sh
|
||||
set -eu
|
||||
|
||||
root="${AMPB_BROWSER_BUILD_ROOT:-/tmp/ampb-browser-build}"
|
||||
src="$root/src"
|
||||
|
||||
gecko_repo="${AMPB_GECKO_REPO:-https://github.com/mozilla/gecko-dev.git}"
|
||||
legacy_android_repo="${AMPB_LEGACY_FIREFOX_ANDROID_REPO:-https://github.com/mozilla-mobile/firefox-android.git}"
|
||||
tor_build_repo="${AMPB_TOR_BROWSER_BUILD_REPO:-https://gitlab.torproject.org/tpo/applications/tor-browser-build.git}"
|
||||
|
||||
mkdir -p "$src"
|
||||
|
||||
sync_repo() {
|
||||
repo_url="$1"
|
||||
dest="$2"
|
||||
mode="$3"
|
||||
if [ -d "$dest/.git" ]; then
|
||||
if [ "$mode" = "blobless" ]; then
|
||||
git -C "$dest" fetch --depth 1 --filter=blob:none origin
|
||||
else
|
||||
git -C "$dest" fetch --depth 1 origin
|
||||
fi
|
||||
git -C "$dest" reset --hard FETCH_HEAD
|
||||
else
|
||||
if [ "$mode" = "blobless" ]; then
|
||||
git clone --depth 1 --filter=blob:none "$repo_url" "$dest"
|
||||
else
|
||||
git clone --depth 1 "$repo_url" "$dest"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
sync_repo "$gecko_repo" "$src/gecko-dev" "blobless"
|
||||
sync_repo "$tor_build_repo" "$src/tor-browser-build" "normal"
|
||||
|
||||
if [ "${AMPB_INCLUDE_LEGACY_FIREFOX_ANDROID:-0}" = "1" ]; then
|
||||
sync_repo "$legacy_android_repo" "$src/firefox-android" "normal"
|
||||
fi
|
||||
|
||||
printf 'AMPB_SOURCE_SYNC status=ok root=%s\n' "$root"
|
||||
Reference in New Issue
Block a user