aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Mortier <mort@cantab.net>2019-09-07 23:04:24 +0100
committerRichard Mortier <mort@cantab.net>2019-09-07 23:04:24 +0100
commit8dfe1b93fb0dc085d26facc2d5258df15c8f7c44 (patch)
tree02b3bbceae0eccdb4f9828f9ec2926eb9d3960fd
parent4ee09ab5053e22f6ab1bd309ab4524e8ff5a81df (diff)
downloaddocker-abuild-8dfe1b93fb0dc085d26facc2d5258df15c8f7c44.tar.bz2
docker-abuild-8dfe1b93fb0dc085d26facc2d5258df15c8f7c44.tar.xz
dabuild: require `aports` tree is exactly in `.../aports/` on host
Signed-off-by: Richard Mortier <mort@cantab.net>
-rwxr-xr-xdabuild.in10
1 files 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 "$@"