summaryrefslogtreecommitdiffstats
path: root/scripts/ci/checkout-oe.sh
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/ci/checkout-oe.sh')
-rwxr-xr-xscripts/ci/checkout-oe.sh78
1 files changed, 0 insertions, 78 deletions
diff --git a/scripts/ci/checkout-oe.sh b/scripts/ci/checkout-oe.sh
deleted file mode 100755
index e8a2473..0000000
--- a/scripts/ci/checkout-oe.sh
+++ /dev/null
@@ -1,78 +0,0 @@
1#!/usr/bin/env bash
2
3set -euo pipefail
4
5set -x
6
7REMOTE_SOURCE=${REMOTE_SOURCE:-https://github.com/advancedtelematic}
8MANIFEST=${MANIFEST:-master}
9CURRENT_PROJECT=${CURRENT_PROJECT:-}
10
11# list of projects to pin to one version in the format:
12# "project:rev;project2:rev2..."
13PIN_LIST=${PIN_LIST:-}
14
15#CURRENT_REV=$(git rev-parse HEAD)
16LOCAL_REPO=$PWD
17
18mkdir -p updater-repo
19
20cd updater-repo
21
22if [ -d .repo/manifests ]; then
23 git -C .repo/manifests reset --hard
24fi
25
26repo init -m "${MANIFEST}.xml" -u "$REMOTE_SOURCE/updater-repo"
27
28# patch manifest:
29# - add a new "ats" remote that points to "$REMOTE_SOURCE"
30# - change projects that contain "advancedtelematic" to use the ats remote
31MANIFEST_FILE=".repo/manifests/${MANIFEST}.xml"
32xmlstarlet ed --omit-decl -L \
33 -s "/manifest" -t elem -n "remote" -v "" \
34 -i "/manifest/remote[last()]" -t attr -n "name" -v "ats" \
35 -i "/manifest/remote[last()]" -t attr -n "fetch" -v "$REMOTE_SOURCE" \
36 -d "/manifest/project[contains(@name, 'advancedtelematic')]/@remote" \
37 -i "/manifest/project[contains(@name, 'advancedtelematic')]" -t attr -n "remote" -v "ats" \
38 "$MANIFEST_FILE"
39
40# hack: sed on `advancedtelematic/` names, to remove this unwanted prefix
41sed -i 's#name="advancedtelematic/#name="#g' "$MANIFEST_FILE"
42
43# pin projects from the list
44(
45IFS=";"
46for pin in $PIN_LIST; do
47 IFS=":"
48 read -r project rev <<< "$pin"
49 xmlstarlet ed --omit-decl -L \
50 -d "/manifest/project[@name=\"$project\"]/@revision" \
51 -i "/manifest/project[@name=\"$project\"]/@revision" -t attr -n "revision" -v "$rev" \
52 -i "/manifest/project[@name=\"$project\"]" -t attr -n "revision" -v "$rev" \
53 "$MANIFEST_FILE"
54 IFS=";"
55done
56)
57
58# Remove the current project from the manifest if we have it checked out
59if [ -n "$CURRENT_PROJECT" ]; then
60 xmlstarlet ed --omit-decl -L \
61 -d "/manifest/project[@name=\"$CURRENT_PROJECT\"]" \
62 "$MANIFEST_FILE"
63fi
64
65repo manifest
66
67# Try to clean up the repos in case they are messed up, but this returns an
68# error code if the repos don't exist, which the subsequent repo sync will fix.
69repo forall -c 'git reset --hard ; git clean -fdx' || true
70
71repo sync -d --force-sync
72
73if [ -n "$CURRENT_PROJECT" ]; then
74 rm -f "$CURRENT_PROJECT"
75 ln -s "$LOCAL_REPO" "$CURRENT_PROJECT"
76fi
77
78repo manifest -r