summaryrefslogtreecommitdiff
path: root/src/chroot-tools/libremakepkg.gpl2
diff options
context:
space:
mode:
authorLuke Shumaker <LukeShu@sbcglobal.net>2012-12-02 22:42:41 -0500
committerLuke Shumaker <LukeShu@sbcglobal.net>2012-12-09 14:20:48 -0500
commit70e1601042250b395659f4c325ae7a73cbe238ab (patch)
tree386b7ba9274217c6b4a5e695e25cb9761dfe22e0 /src/chroot-tools/libremakepkg.gpl2
parentd17a673ba0a62f6f8755484a574e9ab0186ab705 (diff)
libremakepkg: learn '-C' to dissable using the chroot
Diffstat (limited to 'src/chroot-tools/libremakepkg.gpl2')
-rwxr-xr-xsrc/chroot-tools/libremakepkg.gpl219
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() {