File tree Expand file tree Collapse file tree
configuration/steps/commands Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -95,7 +95,13 @@ def as_cmd_arg(self) -> list[str]:
9595set -euo pipefail
9696
9797base_url="https://ci.mariadb.org/%(prop:tarbuildnum)s/{ self .ci_builder } "
98- filename=$(curl -fsSL "$base_url/" | grep -oE 'href="mariadb-[^"]*-linux[^"]*\\ .tar\\ .gz"' | head -1 | sed -E 's/^href="(.*)"$/\\ 1/')
98+ # `... | head -1` here would let head close the pipe as soon as it has its
99+ # one line, which under pipefail can turn curl/tar's resulting SIGPIPE into
100+ # a hard failure of the whole step (seen in practice with tar -tzf listing a
101+ # whole bintar's contents). `awk 'NR==1'` picks the same first line but
102+ # still reads its input through to EOF, so the upstream command always
103+ # exits normally instead of getting killed by a broken pipe.
104+ filename=$(curl -fsSL "$base_url/" | grep -oE 'href="mariadb-[^"]*-linux[^"]*\\ .tar\\ .gz"' | sed -E 's/^href="(.*)"$/\\ 1/' | awk 'NR==1')
99105if [ -z "$filename" ]; then
100106 echo "Could not find a server bintar under $base_url" >&2
101107 exit 1
@@ -105,7 +111,7 @@ def as_cmd_arg(self) -> list[str]:
105111curl -fsSL "$base_url/$filename" -o "/home/buildbot/bintar/$filename"
106112tar -xzf "/home/buildbot/bintar/$filename" -C /home/buildbot/bintar
107113
108- dirname=$(tar -tzf "/home/buildbot/bintar/$filename" | head -1 | cut -d/ -f1 )
114+ dirname=$(tar -tzf "/home/buildbot/bintar/$filename" | awk -F/ 'NR==1{{print $1}}' )
109115echo "/home/buildbot/bintar/$dirname"
110116"""
111117 ),
You can’t perform that action at this time.
0 commit comments