Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

Commit 87e91fd

Browse files
jq update workaround
1 parent 56e0a67 commit 87e91fd

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

.maintain/gitlab/check_polkadot_companion_build.sh

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,17 @@ from this pull request. otherwise, it will uses master instead
3737
3838
EOT
3939

40+
# FIXME: update jq in the CI file
41+
42+
jq="$PWD/jq16"
43+
curl -sqL https://github.com/stedolan/jq/releases/download/jq-1.6/jq-linux64 -o "$jq"
44+
chmod +x "$jq"
45+
jq_sha256sum="af986793a515d500ab2d35f8d2aecd656e764504b789b66d7e1a0b727a124c44 $jq"
46+
if [ "$(sha256sum "$jq")" != "$jq_sha256sum" ]; then
47+
echo "ERROR: jq sha256sum mismatch"
48+
exit 1
49+
fi
50+
4051
# Set the user name and email to make merging work
4152
git config --global user.name 'CI system'
4253
git config --global user.email '<>'
@@ -105,7 +116,7 @@ load_our_crates() {
105116
else
106117
our_crates+=("$crate")
107118
fi
108-
done < <(cargo metadata --quiet --format-version=1 | jq -r '
119+
done < <(cargo metadata --quiet --format-version=1 | "$jq" -r '
109120
. as $in |
110121
paths |
111122
select(.[-1]=="source" and . as $p | $in | getpath($p)==null) as $path |
@@ -124,14 +135,13 @@ match_their_crates() {
124135
local target_name="$(basename "$target_dir")"
125136
local crates_not_found=()
126137

127-
local found
128-
129138
# output will be provided in the format:
130139
# crate
131140
# source
132141
# crate
133142
# ...
134143
local next="crate"
144+
local found
135145
while IFS= read -r line; do
136146
case "$next" in
137147
crate)
@@ -171,7 +181,7 @@ match_their_crates() {
171181
exit 1
172182
;;
173183
esac
174-
done < <(cargo metadata --quiet --format-version=1 | jq -r '
184+
done < <(cargo metadata --quiet --format-version=1 | "$jq" -r '
175185
. as $in |
176186
paths(select(type=="string")) |
177187
select(.[-1]=="source") as $source_path |
@@ -180,7 +190,7 @@ match_their_crates() {
180190
.[]
181191
')
182192

183-
if [ "$crates_not_found" ]; then
193+
if [ "${crates_not_found[@]}" ]; then
184194
echo "Errors during crate matching"
185195
printf "Failed to find crate \"%s\" referenced in $target_name\n" "${crates_not_found[@]}"
186196
exit 1

0 commit comments

Comments
 (0)