diff options
Diffstat (limited to 'scripts/ci/checkout-oe.sh')
-rwxr-xr-x | scripts/ci/checkout-oe.sh | 76 |
1 files changed, 0 insertions, 76 deletions
diff --git a/scripts/ci/checkout-oe.sh b/scripts/ci/checkout-oe.sh deleted file mode 100755 index fdc0e48..0000000 --- a/scripts/ci/checkout-oe.sh +++ /dev/null | |||
@@ -1,76 +0,0 @@ | |||
1 | #!/usr/bin/env bash | ||
2 | |||
3 | set -euo pipefail | ||
4 | |||
5 | set -x | ||
6 | |||
7 | REMOTE_SOURCE=${REMOTE_SOURCE:-https://github.com/advancedtelematic} | ||
8 | MANIFEST=${MANIFEST:-master} | ||
9 | CURRENT_PROJECT=${CURRENT_PROJECT:-} | ||
10 | |||
11 | # list of projects to pin to one version in the format: | ||
12 | # "project:rev;project2:rev2..." | ||
13 | PIN_LIST=${PIN_LIST:-} | ||
14 | |||
15 | #CURRENT_REV=$(git rev-parse HEAD) | ||
16 | LOCAL_REPO=$PWD | ||
17 | |||
18 | mkdir -p updater-repo | ||
19 | |||
20 | cd updater-repo | ||
21 | |||
22 | if [ -d .repo/manifests ]; then | ||
23 | git -C .repo/manifests reset --hard | ||
24 | fi | ||
25 | |||
26 | repo 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 | ||
31 | MANIFEST_FILE=".repo/manifests/${MANIFEST}.xml" | ||
32 | xmlstarlet 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 | ||
41 | sed -i 's#name="advancedtelematic/#name="#g' "$MANIFEST_FILE" | ||
42 | |||
43 | # pin projects from the list | ||
44 | ( | ||
45 | IFS=";" | ||
46 | for 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=";" | ||
55 | done | ||
56 | ) | ||
57 | |||
58 | # Remove the current project from the manifest if we have it checked out | ||
59 | if [ -n "$CURRENT_PROJECT" ]; then | ||
60 | xmlstarlet ed --omit-decl -L \ | ||
61 | -d "/manifest/project[@name=\"$CURRENT_PROJECT\"]" \ | ||
62 | "$MANIFEST_FILE" | ||
63 | fi | ||
64 | |||
65 | repo manifest | ||
66 | |||
67 | repo forall -c 'git reset --hard ; git clean -fdx' | ||
68 | |||
69 | repo sync -d --force-sync | ||
70 | |||
71 | if [ -n "$CURRENT_PROJECT" ]; then | ||
72 | rm -f "$CURRENT_PROJECT" | ||
73 | ln -s "$LOCAL_REPO" "$CURRENT_PROJECT" | ||
74 | fi | ||
75 | |||
76 | repo manifest -r | ||