Commit e76192fa authored by Natanael Copa's avatar Natanael Copa

abuild: do not create the apk index as root

parent ea206bfe
...@@ -20,7 +20,8 @@ abuild_path=$(readlink -f $0) ...@@ -20,7 +20,8 @@ abuild_path=$(readlink -f $0)
BUILD_BASE="build-base" BUILD_BASE="build-base"
FAKEROOT=${FAKEROOT:-"fakeroot"} FAKEROOT=${FAKEROOT:-"fakeroot"}
: ${APK:=abuild-apk} : ${SUDO_APK:=abuild-apk}
: ${APK:=apk}
: ${ADDUSER:=abuild-adduser} : ${ADDUSER:=abuild-adduser}
: ${ADDGROUP:=abuild-addgroup} : ${ADDGROUP:=abuild-addgroup}
...@@ -103,7 +104,7 @@ cleanup() { ...@@ -103,7 +104,7 @@ cleanup() {
set_xterm_title "" set_xterm_title ""
if [ -z "$install_after" ] && [ -n "$uninstall_after" ]; then if [ -z "$install_after" ] && [ -n "$uninstall_after" ]; then
msg "Uninstalling dependencies..." msg "Uninstalling dependencies..."
$APK del --quiet $apk_opt_wait $uninstall_after $SUDO_APK del --quiet $apk_opt_wait $uninstall_after
fi fi
if [ -n "$CLEANUP_FILES" ]; then if [ -n "$CLEANUP_FILES" ]; then
rm -f $CLEANUP_FILES rm -f $CLEANUP_FILES
...@@ -1292,10 +1293,10 @@ builddeps() { ...@@ -1292,10 +1293,10 @@ builddeps() {
if [ -n "$install_deps" ] && [ -z "$recursive" ] && [ -n "$deps" ]; then if [ -n "$install_deps" ] && [ -z "$recursive" ] && [ -n "$deps" ]; then
# make a --simluate run first to detect missing deps # make a --simluate run first to detect missing deps
# apk-tools --virtual is no goot at reporting those. # apk-tools --virtual is no goot at reporting those.
$APK add --repository "$abuildrepo" \ $SUDO_APK add --repository "$abuildrepo" \
$apk_opt_wait \ $apk_opt_wait \
--simulate --quiet $deps || return 1 --simulate --quiet $deps || return 1
$APK add --repository "$abuildrepo" \ $SUDO_APK add --repository "$abuildrepo" \
$apk_opt_wait \ $apk_opt_wait \
--virtual .makedepends-$pkgname $deps \ --virtual .makedepends-$pkgname $deps \
&& return 0 && return 0
...@@ -1327,7 +1328,7 @@ builddeps() { ...@@ -1327,7 +1328,7 @@ builddeps() {
cd "$dir" && $0 $forceroot $keep $quiet $install_deps \ cd "$dir" && $0 $forceroot $keep $quiet $install_deps \
$recursive $upgrade $color_opt abuildindex || return 1 $recursive $upgrade $color_opt abuildindex || return 1
done done
$APK add -u --repository "$abuildrepo" \ $SUDO_APK add -u --repository "$abuildrepo" \
$apk_opt_wait \ $apk_opt_wait \
--virtual .makedepends-$pkgname $deps --virtual .makedepends-$pkgname $deps
} }
...@@ -1442,18 +1443,18 @@ post_add() { ...@@ -1442,18 +1443,18 @@ post_add() {
post_add $i || return 1 post_add $i || return 1
fi fi
done done
$APK add $apk_opt_wait -u "$pkgf" || die "Failed to install $1" $SUDO_APK add $apk_opt_wait -u "$pkgf" || die "Failed to install $1"
} }
installdeps() { installdeps() {
local deps i local deps i
$APK add $apk_opt_wait --repository "$abuildrepo" \ $SUDO_APK add $apk_opt_wait --repository "$abuildrepo" \
--virtual .makedepends-$pkgname \ --virtual .makedepends-$pkgname \
$makedepends $makedepends
} }
uninstalldeps (){ uninstalldeps (){
$APK del $apk_opt_wait .makedepends-$pkgname $SUDO_APK del $apk_opt_wait .makedepends-$pkgname
} }
all() { all() {
......
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