Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ci-automation/garbage_collect_github_ci_sdk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ function _garbage_collect_github_ci_impl() {
echo "${versions_sorted}" | awk '{printf "%5d %s\n", NR, $0}'

local purge_versions
mapfile -t purge_versions < <(unset POSIXLY_CORRECT; \
mapfile -t purge_versions < <(
echo "${versions_sorted}" \
| awk -v keep="${keep}" -v min_age="${min_age_date}" '{
if (keep > 0) {
Expand Down
7 changes: 2 additions & 5 deletions ci-automation/garbage_collect_releases.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,7 @@ function _garbage_collect_releases_impl() {
source ci-automation/ci_automation_common.sh
local sshcmd="$(gen_sshcmd)"

local keep=$(
# For some reasons this is set to the empty string in some environments and it makes gawk
# behave like POSIX awk (i.e. no 'gensub').
unset POSIXLY_CORRECT
local keep=$(
curl -s "${RELEASES_JSON_FEED}" \
| jq -r 'keys_unsorted | .[] | match("[0-9]+\\.[0-9]+\\.[0-9]+") | .string' \
| sort -Vr \
Expand Down Expand Up @@ -102,7 +99,7 @@ function _garbage_collect_releases_impl() {
# skip if candidate version is marked for keeping OR if it's a new release about to be published
# or if it ships an SDK used by a version in the keep list.
if printf "%s\n" "${keep_versions[@]}" \
| { unset POSIXLY_CORRECT ; awk -v candidate_version="${version}" -v path="${dir}" '
| { awk -v candidate_version="${version}" -v path="${dir}" '
BEGIN {
# Candidate version (from build cache directory) that was passed in candidate_version variable
candidate_major = gensub("([0-9]+)\\.[0-9]+\\.[0-9]+","\\1","g", candidate_version) + 0
Expand Down
6 changes: 4 additions & 2 deletions jenkins/systemd-run-wrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@ export PATH="$PATH:/opt/bin"

# Use a system session unit because the user session may not be set up correctly in a CI env
ARGS=("--system" "--collect" "--same-dir" "--pipe" "--wait" "--property=User=$USER" "--property=Group=$USER")
# Extra "sh -c" is needed to only export the exported variables
for VARNAME in $(sh -c 'compgen -v'); do
# Extra "bash -c" is needed to only export the exported variables. Do
# not use sh - it will add POSIXLY_CORRECT into the environment, which
# is unnecessary.
for VARNAME in $(bash -c 'compgen -v'); do
set +u
VAL="${!VARNAME}"
set -u
Expand Down
Loading