summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaarle Ritvanen <kaarle.ritvanen@datakunkku.fi>2019-05-30 11:54:10 +0300
committerKaarle Ritvanen <kaarle.ritvanen@datakunkku.fi>2019-08-07 14:30:46 +0300
commitbaa554477e651d0999ca8a9751a271032c2f5769 (patch)
treec3875548096366be4a2e41b32274801bd1561051
parent9a398eac0c0ac854e5cc05f1b58c54a0f40ebc5f (diff)
downloadabuild-repo-deps.tar.bz2
abuild-repo-deps.tar.xz
abuild: install dependencies from other reposrepo-deps
-rw-r--r--abuild.in32
1 files changed, 24 insertions, 8 deletions
diff --git a/abuild.in b/abuild.in
index 79415e4..cb20e4b 100644
--- a/abuild.in
+++ b/abuild.in
@@ -36,6 +36,10 @@ export SOURCE_DATE_EPOCH
umask 022
+shell_escape() {
+ echo \'${1/\'/\'\\\'\'}\'
+}
+
# run optional log command for remote logging
logcmd() {
${ABUILD_LOG_CMD:-true} "$@"
@@ -2003,6 +2007,19 @@ get_missing_deps() {
done
}
+apk_add_makedeps() {
+ local prefix=$1
+ shift
+
+ local repo_args="--repository $(shell_escape "$REPODEST/$repo")"
+ [ -s "$repo_template" ] && repo_args=$(while read r; do
+ echo --repository "$(shell_escape "$REPODEST/${r##*/}")"
+ done) < "$repo_template"
+
+ eval $SUDO_APK add $apk_opt_wait $repo_args \
+ --virtual .${prefix}depends-$pkgname "\$@" || return
+}
+
# build and install dependencies
builddeps() {
local pkg= i= BUILD_BASE=
@@ -2103,7 +2120,6 @@ rootbld() {
mkusers
BUILD_ROOT=$(mktemp -d /var/tmp/abuild.XXXXXXXXXX)
- local aportsgit=${APORTSDIR:-${startdir}}
mkdir -p "$BUILD_ROOT/proc" "$BUILD_ROOT/etc/apk/keys" \
"$BUILD_ROOT/$HOME/.abuild" "$BUILD_ROOT/$aportsgit" \
@@ -2125,7 +2141,6 @@ rootbld() {
buildhost=${gitref/./-}
fi
- local repo_template=$aportsgit/$repo/.rootbld-repositories
[ -s "$repo_template" ] || die "rootbld: $repo_template does not exist"
(
for key in $(git config --list --name-only); do
@@ -2283,14 +2298,12 @@ deps() {
local _quiet="$1"
[ -z "$_quiet" ] && msg "Installing for build:$builddeps"
- $SUDO_APK add $_quiet $apk_opt_wait --repository "$REPODEST/$repo" \
- --virtual .makedepends-$pkgname \
- $builddeps \
- || return 1
+ apk_add_makedeps make $_quiet $builddeps || return 1
if [ -n "$CBUILDROOT" ]; then
[ -z "$_quiet" ] && msg "Installing for host:$hostdeps"
- $SUDO_APK add $_quiet --root "$CBUILDROOT" --arch "$CTARGET_ARCH" --repository "$REPODEST/$repo" $apk_opt_wait \
- --no-scripts --virtual .hostdepends-$pkgname $hostdeps || return 1
+ apk_add_makedeps host $_quiet --no-scripts \
+ --root "$CBUILDROOT" --arch "$CTARGET_ARCH" $hostdeps \
+ || return 1
fi
}
@@ -2477,6 +2490,9 @@ pkgbasedir=${pkgbasedir:-"$startdir/pkg"}
repo=${startdir%/*}
repo=${repo##*/}
+aportsgit=${APORTSDIR:-${startdir}}
+repo_template=$aportsgit/$repo/.rootbld-repositories
+
SRCDEST=${SRCDEST:-$startdir}
BUILD_ROOT=