Skip to content

Commit fac424f

Browse files
author
MarcoFalke
committed
ci: Create named symbol for BINS_SCRATCH_DIR
Also, create the dir a bit earlier, right after it was put in the PATH.
1 parent 49aefc2 commit fac424f

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

ci/test/04_install.sh

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ if [[ $BITCOIN_CONFIG = *--with-sanitizers=*address* ]]; then # If ran with (ASa
2424
fi
2525

2626
export P_CI_DIR="$PWD"
27+
export BINS_SCRATCH_DIR="${BASE_SCRATCH_DIR}/bins/"
2728

2829
if [ -z "$DANGER_RUN_CI_ON_HOST" ]; then
2930
echo "Creating $DOCKER_NAME_TAG container to run in"
@@ -64,14 +65,16 @@ else
6465
fi
6566

6667
CI_EXEC () {
67-
$DOCKER_CI_CMD_PREFIX bash -c "export PATH=$BASE_SCRATCH_DIR/bins/:\$PATH && cd \"$P_CI_DIR\" && $*"
68+
$DOCKER_CI_CMD_PREFIX bash -c "export PATH=${BINS_SCRATCH_DIR}:\$PATH && cd \"$P_CI_DIR\" && $*"
6869
}
6970
CI_EXEC_ROOT () {
70-
$DOCKER_CI_CMD_PREFIX_ROOT bash -c "export PATH=$BASE_SCRATCH_DIR/bins/:\$PATH && cd \"$P_CI_DIR\" && $*"
71+
$DOCKER_CI_CMD_PREFIX_ROOT bash -c "export PATH=${BINS_SCRATCH_DIR}:\$PATH && cd \"$P_CI_DIR\" && $*"
7172
}
7273
export -f CI_EXEC
7374
export -f CI_EXEC_ROOT
7475

76+
CI_EXEC mkdir -p "${BINS_SCRATCH_DIR}"
77+
7578
if [ -n "$DPKG_ADD_ARCH" ]; then
7679
CI_EXEC_ROOT dpkg --add-architecture "$DPKG_ADD_ARCH"
7780
fi
@@ -155,12 +158,11 @@ fi
155158

156159
if [ "$USE_BUSY_BOX" = "true" ]; then
157160
echo "Setup to use BusyBox utils"
158-
CI_EXEC mkdir -p "${BASE_SCRATCH_DIR}/bins/"
159161
# tar excluded for now because it requires passing in the exact archive type in ./depends (fixed in later BusyBox version)
160162
# find excluded for now because it does not recognize the -delete option in ./depends (fixed in later BusyBox version)
161163
# ar excluded for now because it does not recognize the -q option in ./depends (unknown if fixed)
162164
# shellcheck disable=SC1010
163-
CI_EXEC for util in \$\(busybox --list \| grep -v "^ar$" \| grep -v "^tar$" \| grep -v "^find$"\)\; do ln -s \$\(command -v busybox\) "${BASE_SCRATCH_DIR}/bins/\$util"\; done
165+
CI_EXEC for util in \$\(busybox --list \| grep -v "^ar$" \| grep -v "^tar$" \| grep -v "^find$"\)\; do ln -s \$\(command -v busybox\) "${BINS_SCRATCH_DIR}/\$util"\; done
164166
# Print BusyBox version
165167
CI_EXEC patch --help
166168
fi

0 commit comments

Comments
 (0)