summaryrefslogtreecommitdiff
path: root/stacks/crdop/scripts/refresh-vendor-ardopcf.sh
blob: b9d2f931106ea3fb4ae8a04639cd52f2727d7187 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/usr/bin/env bash
# Maintainer tool: re-download upstream ardopcf and re-apply CRDOP patches.
# Normal builds use the committed vendor/ardopcf tree — no network required.
set -euo pipefail

ROOT="$(cd "$(dirname "$0")/.." && pwd)"
VENDOR="${ROOT}/vendor/ardopcf"
REF_FILE="${ROOT}/vendor/ardopcf.ref"
URL="${CRDOP_UPSTREAM_URL:-https://github.com/pflarue/ardop.git}"
PIN="$(grep '^commit_full=' "${REF_FILE}" 2>/dev/null | cut -d= -f2- | head -1)"
PIN="${PIN:-$(grep '^commit=' "${REF_FILE}" 2>/dev/null | cut -d= -f2- | head -1)}"

echo "This replaces vendor/ardopcf from upstream. Press Ctrl+C to abort."
sleep 2

rm -rf "${VENDOR}"
git clone --depth 1 --branch master "${URL}" "${VENDOR}"
if [[ -n "${PIN}" ]]; then
    git -C "${VENDOR}" fetch --depth 1 origin "${PIN}"
    git -C "${VENDOR}" checkout "${PIN}"
fi
rm -rf "${VENDOR}/.git"
rm -f "${VENDOR}/.crdop-patches-applied"

"${ROOT}/scripts/apply-vendor-patches.sh"
echo "Done. Review diff, update vendor/ardopcf.ref if needed, commit vendor/ardopcf/"
git clone -b <branch> https://cgit.mode42.com/<repo>.git
git clone -b <branch> git://cgit.mode42.com/<repo>.git

info@mode42.com