From 8dfe1b93fb0dc085d26facc2d5258df15c8f7c44 Mon Sep 17 00:00:00 2001 From: Richard Mortier Date: Sat, 7 Sep 2019 23:04:24 +0100 Subject: dabuild: require `aports` tree is exactly in `.../aports/` on host Signed-off-by: Richard Mortier --- dabuild.in | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/dabuild.in b/dabuild.in index 76e23ed..9c83102 100755 --- a/dabuild.in +++ b/dabuild.in @@ -17,9 +17,9 @@ if [ "$DABUILD_DEBUG" = "true" ]; then fi ## check running from within an `aports` tree -if [ "${PWD%*/aports*}" = "$PWD" ]; then +if [ "${PWD%*/aports/*}" = "$PWD" ]; then die "Error: expecting to be run from within an aports tree!" \ - "Could not find '/aports' in the current path ($PWD)" + "Could not find '/aports/' in the current path: $PWD" exit 1 fi @@ -48,7 +48,7 @@ else fi ## check $DABUILD_PACKAGES is a writable directory -ABUILD_PACKAGES=${DABUILD_PACKAGES:-${PWD%/aports*}/packages/${ABUILD_VERSION}} +ABUILD_PACKAGES=${DABUILD_PACKAGES:-${PWD%/aports/*}/packages/${ABUILD_VERSION}} mkdir -p $ABUILD_PACKAGES if [ ! \( -d "$ABUILD_PACKAGES" -a -w "$ABUILD_PACKAGES" \) ]; then @@ -59,7 +59,7 @@ fi ## setup volumes; use named volumes as cache if desired ABUILD_VOLUMES="-v ${HOME}/.abuild:/home/builder/.abuild \ - -v ${PWD%/aports*}/aports:/home/builder/aports \ + -v ${PWD%/aports/*}/aports:/home/builder/aports \ -v ${ABUILD_PACKAGES}:/home/builder/packages" if [ -f "/etc/abuild.conf" ]; then @@ -87,7 +87,7 @@ if [ "$DABUILD_CACHE" = "true" ]; then fi ## go! -ABUILD_WORKDIR=/home/builder/aports${PWD#*/aports} +ABUILD_WORKDIR=/home/builder/aports/${PWD#*/aports/} DOCKER="docker run -ti $ABUILD_VOLUMES -e DABUILD_DEBUG $DABUILD_ARGS" $DOCKER --workdir $ABUILD_WORKDIR \ %%ABUILD_IMAGE%%:$ABUILD_VERSION-$DABUILD_ARCH "$@" -- cgit v1.2.3