abuild: don't use fakeroot as it hangs for some reason

Seems that fakeroot makes 'abuild' unusable. Perhaps this is
fakeroot(tcp)-specific bug ?

Anyway, fakeroot is not needed in Termux as we don't setting
ownership for packages but only permissions (chmod).
This commit is contained in:
Leonid Pliushch 2018-11-19 14:08:55 +02:00 committed by Fredrik Fornwall
parent 98d0c10e9d
commit 6fb3feaf24

View File

@ -1,22 +1,110 @@
diff -uNr abuild-3.2.0/abuild.in abuild-3.2.0.mod/abuild.in
--- abuild-3.2.0/abuild.in 2018-06-22 10:24:10.000000000 +0300
+++ abuild-3.2.0.mod/abuild.in 2018-11-18 14:02:51.382830979 +0200
+++ abuild-3.2.0.mod/abuild.in 2018-11-18 15:32:09.638859377 +0200
@@ -1,4 +1,4 @@
-#!/bin/ash -e
+#!/bin/bash -e
# abuild - build apk packages (light version of makepkg)
# Copyright (c) 2008-2015 Natanael Copa <ncopa@alpinelinux.org>
@@ -22,7 +22,7 @@
@@ -21,8 +21,7 @@
. "$datadir/functions.sh"
# defaults
: ${FAKEROOT:="fakeroot"}
-: ${FAKEROOT:="fakeroot"}
-: ${SUDO_APK:="abuild-apk"}
+: ${SUDO_APK:="apk"}
: ${APK:="apk"}
: ${ADDUSER:="abuild-adduser"}
: ${ADDGROUP:="abuild-addgroup"}
@@ -2563,7 +2563,7 @@
@@ -933,7 +932,7 @@
echo "# Generated by $(basename $0) $program_version" >"$pkginfo"
if [ -n "$FAKEROOTKEY" ]; then
- echo "# using $($FAKEROOT -v)" >> "$pkginfo"
+ echo "# using $(fakeroot -v)" >> "$pkginfo"
fi
echo "# $(date -u)" >> "$pkginfo"
cat >> "$pkginfo" <<-EOF
@@ -1502,14 +1501,11 @@
}
build_abuildrepo() {
- local d apk _build=build _check=check_fakeroot
+ local d apk _build=build _check=check
if ! is_function package; then
# if package() is missing then build is called from rootpkg
_build=true
fi
- if options_has "!checkroot"; then
- _check=check
- fi
if ! want_check; then
_check=true
fi
@@ -1747,33 +1743,17 @@
type "$1" 2>&1 | head -n 1 | egrep -q "is a (shell )?function"
}
-do_fakeroot() {
- if [ -n "$FAKEROOT" ]; then
- $FAKEROOT -- "$@"
- else
- "$@"
- fi
-}
-
-# wrap check() with fakeroot
-check_fakeroot() {
- cd "$startdir"
- [ -n "$FAKEROOT" ] && msg "Entering fakeroot..."
- do_fakeroot "$abuild_path" $color_opt $keep_build check
-}
-
-# build and package in fakeroot
+# build and package
rootpkg() {
local _package=package
if ! is_function package; then
- # if package() is missing then run 'build' in fakeroot instead
+ # if package() is missing then run 'build' instead
warning "No package() function in APKBUILD"
_package=build
fi
cd "$startdir"
rm -rf "$pkgdir"
- [ -n "$FAKEROOT" ] && msg "Entering fakeroot..."
- do_fakeroot "$abuild_path" $color_opt $keep_build \
+ "$abuild_path" $color_opt $keep_build \
$_package \
prepare_subpackages \
prepare_language_packs \
@@ -2125,14 +2105,11 @@
}
rootbld_actions() {
- local part _build=build _check=check_fakeroot
+ local part _build=build _check=check
if ! is_function package; then
# if package() is missing then build is called from rootpkg
_build=true
fi
- if options_has "!checkroot"; then
- _check=check
- fi
if ! want_check; then
_check=true
fi
@@ -2481,7 +2458,7 @@
package Install project into $pkgdir
prepare Apply patches
rootbld Build package in clean chroot
- rootpkg Run 'package', the split functions and create apks as fakeroot
+ rootpkg Run 'package', the split functions and create apks
sanitycheck Basic sanity check of APKBUILD
snapshot Create a \$giturl or \$svnurl snapshot and upload to \$disturl
sourcecheck Check if remote source package exists upstream
@@ -2563,7 +2540,7 @@
if [ -z "$REPODEST" ]; then
warning "REPODEST is not set and is now required. Defaulting to ~/packages"
[ -n "$PKGDEST" ] && die "PKGDEST is no longer supported."