Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion scripts/build/git-clone.bash
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 )
Expand Down
7 changes: 6 additions & 1 deletion scripts/update-version.bash
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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}")
Expand All @@ -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=
Expand Down
Loading