]> cat aescling's git repositories - httpd-execline.git/commitdiff
build-in-musl-chroot: fix: Fix install; make resilient
authorcat æscling <11325618-aescling@users.noreply.gitlab.com>
Thu, 3 Aug 2023 14:31:50 +0000 (10:31 -0400)
committercat æscling <11325618-aescling@users.noreply.gitlab.com>
Thu, 3 Aug 2023 14:31:50 +0000 (10:31 -0400)
this exact problem with `${CHROOT}` vs `"${CHROOT}"` is exactly what
execline intends to solve

dependencies/build-in-musl-chroot.sh

index 980ed907bbf14ecbdcbfeee2e5b812940ae7c2d1..4bb11f9b38a6bded64a5ec46de9db256234c0f11 100644 (file)
@@ -31,24 +31,24 @@ CHROOT=xbps/_root
 # prepare chroot
 for D in /var/db/xbps/keys /etc /proc /sys /dev /run;
 do
-       mkdir -p ${CHROOT}${D}
+       mkdir -p "${CHROOT}"${D}
 done
-cp -Lr /etc/hosts /etc/resolv.conf ${CHROOT}/etc
-cp -r build.sh _9base _toybox ${CHROOT}
+cp -Lr /etc/hosts /etc/resolv.conf "${CHROOT}"/etc
+cp -r build.sh _9base _toybox "${CHROOT}"
 
 # install into chroot
 (
        cd xbps
        curl -Ss "${XBPS_STATIC}" | unxz -c | tar -xf -
 )
-XBPS_ARCH=${ARCH}-musl ./xbps/usr/bin/xbps-install -y -S -r ${CHROOT} \
+XBPS_ARCH=${ARCH}-musl ./xbps/usr/bin/xbps-install -y -S -r "${CHROOT}" \
                -R ${XBPS_REPOSITORY} \
                base-voidstrap base-devel git
 
 unmount() {
        for D in /proc /sys /dev /run
        do
-               umount ${CHROOT}${D}
+               umount "${CHROOT}"${D}
        done
 }
 
@@ -57,14 +57,14 @@ unmount() {
 # TODO: this behavior is strange
 trap unmount INT TERM EXIT
 
-mount -t proc none ${CHROOT}/proc
-mount -t sysfs none ${CHROOT}/sys
-mount --rbind /dev ${CHROOT}/dev
-mount --rbind /run ${CHROOT}/run
+mount -t proc none "${CHROOT}"/proc
+mount -t sysfs none "${CHROOT}"/sys
+mount --rbind /dev "${CHROOT}"/dev
+mount --rbind /run "${CHROOT}"/run
 
-chroot ${CHROOT} /build.sh
+chroot "${CHROOT}" /build.sh
 
 unmount
 
 # intsall
-cp -fv $(find -type f "${PREFIX}"/bin) "${HTTPD_EXECLINE_ROOT}"/binaries
\ No newline at end of file
+cp -fv $(find -type f "${CHROOT}"/_build/bin) "${HTTPD_EXECLINE_ROOT}"/binaries
\ No newline at end of file