Skip to content

Commit d933933

Browse files
committed
ci,builder: make builder script more robust when creating symlinks
1 parent 62251a5 commit d933933

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

docker/scripts/builder.sh

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,11 +169,14 @@ if [[ -n "$DPDK_VERSION" ]]; then
169169
# Create alias for _avx2 / _avx512 versions
170170
if [[ $DPDK_VERSION == *_* ]]; then
171171
DPDK_VERSION_BASE=${DPDK_VERSION%_*}
172+
# If the folder without _ exists, try to remove it
172173
if [ -e "/opt/dpdk/$DPDK_VERSION_BASE" ]; then
173-
rm -Rf "/opt/dpdk/$DPDK_VERSION_BASE"
174+
rm -Rf "/opt/dpdk/$DPDK_VERSION_BASE" || echo "/opt/dpdk/$DPDK_VERSION_BASE already exists!!"
175+
fi
176+
# If we can create the hard line, we change DPDK_VERSION to the new version without _
177+
if ln -s "/opt/dpdk/$DPDK_VERSION" "/opt/dpdk/$DPDK_VERSION_BASE"; then
178+
DPDK_VERSION=$DPDK_VERSION_BASE
174179
fi
175-
ln -s "/opt/dpdk/$DPDK_VERSION" "/opt/dpdk/$DPDK_VERSION_BASE"
176-
DPDK_VERSION=$DPDK_VERSION_BASE
177180
fi
178181
export DPDK_DIR="/opt/dpdk/$DPDK_VERSION"
179182
echo "DPDK_DIR set to $DPDK_DIR"

0 commit comments

Comments
 (0)