diff --git a/dabuild.in b/dabuild.in index c761c7e..c81d9ca 100755 --- a/dabuild.in +++ b/dabuild.in @@ -58,10 +58,13 @@ else esac fi -## check $DABUILD_PACKAGES is a writable directory ABUILD_PACKAGES=${DABUILD_PACKAGES:-${PWD%/aports/*}/packages/${ABUILD_VERSION}} -mkdir -p $ABUILD_PACKAGES +# docker will create mount points as root if not available so create them first +# use uid 1000 as this is the uid of the builder user in the container +install -d -o 1000 -g 1000 "$ABUILD_PACKAGES" "$HOME"/.abuild + +## check $DABUILD_PACKAGES is a writable directory if [ ! \( -d "$ABUILD_PACKAGES" -a -w "$ABUILD_PACKAGES" \) ]; then die "Error: invalid or unwritable packages directory specified!" \ "ABUILD_PACKAGES = '$ABUILD_PACKAGES'" \ @@ -81,6 +84,11 @@ if [ -w "/var/cache/distfiles" ]; then ABUILD_VOLUMES="$ABUILD_VOLUMES -v /var/cache/distfiles:/var/cache/distfiles" fi +# pass over gitconfig for abuild-keygen +if [ -f "$HOME/.gitconfig" ]; then + ABUILD_VOLUMES="$ABUILD_VOLUMES -v $HOME/.gitconfig:/home/builder/.gitconfig" +fi + if [ "$DABUILD_CACHE" = "true" ]; then for v in %%ABUILD_VOLUMES%% ; do vol=abuild-$ABUILD_VERSION-$DABUILD_ARCH-${v//\//_}