Commit 8dfe1b93 authored by Richard Mortier's avatar Richard Mortier
Browse files

dabuild: require `aports` tree is exactly in `.../aports/` on host


Signed-off-by: Richard Mortier's avatarRichard Mortier <mort@cantab.net>
parent 4ee09ab5
......@@ -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 "$@"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment