From e5ae850add3cfe90333a8ac46f1fa21610e85779 Mon Sep 17 00:00:00 2001 From: Kamil Trzcinski Date: Sun, 2 Nov 2025 19:27:40 +0100 Subject: [PATCH] scripts: allow to configure `PROXMOX_GIT_URL` --- scripts/build/git-clone.bash | 6 +++++- scripts/update-version.bash | 7 ++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/scripts/build/git-clone.bash b/scripts/build/git-clone.bash index 48fa814..c44e1b1 100755 --- a/scripts/build/git-clone.bash +++ b/scripts/build/git-clone.bash @@ -7,9 +7,11 @@ if [[ $# -ne 1 ]] && [[ $# -ne 2 ]]; then exit 1 fi +PROXMOX_GIT_URL="${PROXMOX_GIT_URL:-git://git.proxmox.com/git}" + perform() { if [[ ! -d "$1" ]]; then - git clone "git://git.proxmox.com/git/${3:-$1}.git" "$1" + git clone "${PROXMOX_GIT_URL}/${3:-$1}.git" "$1" else git -C "$1" fetch fi @@ -24,7 +26,9 @@ perform() { } while read REPO COMMIT_SHA REST; do + [[ -n "$REPO" ]] || continue [[ -n "$2" ]] && [[ "$REPO" != "$2" ]] && continue + echo "$REPO $COMMIT_SHA..." 1>&2 REPO_URL=${REST%%#*} ( perform "$REPO" "$COMMIT_SHA" $REPO_URL ) diff --git a/scripts/update-version.bash b/scripts/update-version.bash index d805c30..3ba8b4b 100755 --- a/scripts/update-version.bash +++ b/scripts/update-version.bash @@ -25,6 +25,7 @@ SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) SCRIPT_ROOT=$(realpath "$0") ROOT_REV="${2}" ROOT_TS="" +PROXMOX_GIT_URL="${PROXMOX_GIT_URL:-git://git.proxmox.com/git}" if [[ -z "$TMP_DIR" ]]; then export TMP_DIR=$(mktemp -d -t ci-XXXXXXXXXX) @@ -33,7 +34,9 @@ if [[ -z "$TMP_DIR" ]]; then fi perform() { - [[ -d "$1" ]] || git clone "git://git.proxmox.com/git/${3:-$1}.git" "$1" 2>/dev/null + if [[ ! -d "$1" ]]; then + git clone "${PROXMOX_GIT_URL}/${3:-$1}.git" "$1" 2>/dev/null + fi if [[ "$ROOT_REV" == "HEAD" ]] || [[ -z "$ROOT_TS" ]]; then REPO_REV=$(git -C "$1" rev-parse "${ROOT_REV:-HEAD}") @@ -54,6 +57,8 @@ perform() { } while read REPO COMMIT_SHA REST; do + [[ -n "$REPO" ]] || continue + echo "$REPO $COMMIT_SHA..." 1>&2 REPO_TS= REPO_REV=