diff options
Diffstat (limited to 'src/chroot-tools/libremakepkg.gpl2')
-rwxr-xr-x | src/chroot-tools/libremakepkg.gpl2 | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/src/chroot-tools/libremakepkg.gpl2 b/src/chroot-tools/libremakepkg.gpl2 index fd58d50..9c600ed 100755 --- a/src/chroot-tools/libremakepkg.gpl2 +++ b/src/chroot-tools/libremakepkg.gpl2 @@ -36,6 +36,11 @@ EOF } chroot_extract() { + if $NOCHROOT; then + chcleanup + sudo -u ${LIBREUSER} ${MAKEPKG} ${makepkg_args} -o + return + fi rm -rf "$copydir"/build/* cp PKGBUILD "$copydir/build/" ( @@ -72,14 +77,19 @@ chroot_extract() { } chroot_build() { - chroot_exec -N "sudo -u nobody ${MAKEPKG} ${makepkg_args} -e" + local user=$LIBREUSER + $NOCHROOT || user=nobody + chroot_exec -N "sudo -u ${user} ${MAKEPKG} ${makepkg_args} -e" } chroot_exec() { local flags='' [[ $1 == -N ]] && { flags=$1; shift; } local cmd="$*" - cat >"$copydir/chrootexec" <<EOF + if $NOCHROOT; then + ${cmd} + else + cat >"$copydir/chrootexec" <<EOF #!/bin/bash . /etc/profile export HOME=/build @@ -87,8 +97,9 @@ cd /build ${cmd} EOF - chmod 755 "$copydir/chrootexec" - archroot $flags "$copydir" -r /chrootexec + chmod 755 "$copydir/chrootexec" + archroot $flags "$copydir" -r /chrootexec + fi } copy_pkgs() { |