Skip to content

Commit

Permalink
dabuild: protect arguments more
Browse files Browse the repository at this point in the history
Signed-off-by: Richard Mortier <[email protected]>
  • Loading branch information
mor1 committed Dec 30, 2019
1 parent dc2106c commit 684bfea
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions dabuild.in
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ ABUILD_VOLUMES="-v ${HOME}/.abuild:/home/builder/.abuild \
-v ${ABUILD_PACKAGES}:/home/builder/packages"

dabuild_mkvol () {
vol=$1
vol="$1"
if [ "$DABUILD_CLEAN" = "true" ]; then
## clean the cache if requested
docker rm -f $(docker ps -qaf "volume=$vol") >/dev/null 2>&1 || true
Expand All @@ -88,13 +88,13 @@ dabuild_mkvol () {

## if we have ~/.ccache on host, bind-mount it; else use named per-arch volumes
if [ -w "$HOME/.ccache" ]; then
ccvol=$HOME/.ccache/$DABUILD_ARCH
ccvol="$HOME/.ccache/$DABUILD_ARCH"
if [ ! \( -d "$ccvol" -a -w "$ccvol" \) ]; then
mkdir $ccvol
mkdir "$ccvol"
fi
else
ccvol=abuild-$ABUILD_VERSION-$DABUILD_ARCH-ccache
dabuild_mkvol $ccvol
ccvol="abuild-$ABUILD_VERSION-$DABUILD_ARCH-ccache"
dabuild_mkvol "$ccvol"
fi
ABUILD_VOLUMES="$ABUILD_VOLUMES -v $ccvol:/home/builder/.ccache"

Expand All @@ -108,8 +108,8 @@ fi

if [ "$DABUILD_CACHE" = "true" ]; then
for v in %%ABUILD_VOLUMES%% ; do
vol=abuild-$ABUILD_VERSION-$DABUILD_ARCH-${v//\//_}
dabuild_mkvol $vol
vol="abuild-$ABUILD_VERSION-$DABUILD_ARCH-${v//\//_}"
dabuild_mkvol "$vol"
ABUILD_VOLUMES="$ABUILD_VOLUMES -v $vol:/$v"
done
fi
Expand Down

0 comments on commit 684bfea

Please sign in to comment.