aboutsummaryrefslogtreecommitdiffstats
path: root/entrypoint.sh
diff options
context:
space:
mode:
Diffstat (limited to 'entrypoint.sh')
-rwxr-xr-xentrypoint.sh16
1 files changed, 12 insertions, 4 deletions
diff --git a/entrypoint.sh b/entrypoint.sh
index c9dfc55..a76a84d 100755
--- a/entrypoint.sh
+++ b/entrypoint.sh
@@ -13,10 +13,8 @@ if [ "$DABUILD_DEBUG" = "true" ]; then
PS4='$LINENO: '
fi
-## check can write to ~/.abuild
-if [ ! -w "$HOME/.abuild/" ]; then
- die "Error: unwritable ~/.abuild [$(ls -lad ~/.abuild | cut -d " " -f 1)]"
-fi
+# enable ccache if requested
+[ "$DABUILD_CCACHE" = "true" ] && export USE_CCACHE=1
## generate signing keys on first run
if [ ! -r "$HOME/.abuild/abuild.conf" ]; then
@@ -30,6 +28,16 @@ fi
fi
)
+# make sure distfiles has correct permissions
+sudo install -d -m 775 -g abuild /var/cache/distfiles
+
+# correct permissions of user volumes
+for vpath in /home/builder/.ccache /home/builder/.abuild \
+ /home/builder/packages
+do
+ [ -d "$vpath" ] && sudo chown builder:builder "$vpath"
+done
+
sudo cp -v "$HOME"/.abuild/*.rsa.pub /etc/apk/keys/
sudo apk -U upgrade -a