From a11202812449d644db35227b1e012987fd1f3c9f Mon Sep 17 00:00:00 2001 From: Olaf Mersmann Date: Sat, 9 Jan 2021 01:44:35 +0100 Subject: [PATCH] shutils/chroot.sh: move homedir to /tmp/fake-home. starship tests fail if /tmp is $HOME because they create files inside /tmp and compare the shortend path to an expected path. If /tmp is $HOME, starship contracts it to ~ which does not match the expected value. --- common/xbps-src/shutils/chroot.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/common/xbps-src/shutils/chroot.sh b/common/xbps-src/shutils/chroot.sh index 8646d758549..e4bf4129826 100644 --- a/common/xbps-src/shutils/chroot.sh +++ b/common/xbps-src/shutils/chroot.sh @@ -88,7 +88,7 @@ PATH=/void-packages:/usr/bin exec env -i -- SHELL=/bin/sh PATH="\$PATH" DISTCC_HOSTS="\$XBPS_DISTCC_HOSTS" DISTCC_DIR="/host/distcc" \ ${XBPS_ARCH+XBPS_ARCH=$XBPS_ARCH} ${XBPS_CHECK_PKGS+XBPS_CHECK_PKGS=$XBPS_CHECK_PKGS} \ - CCACHE_DIR="/host/ccache" IN_CHROOT=1 LC_COLLATE=C LANG=en_US.UTF-8 TERM=linux HOME="/tmp" \ + CCACHE_DIR="/host/ccache" IN_CHROOT=1 LC_COLLATE=C LANG=en_US.UTF-8 TERM=linux HOME="/tmp/fake-home" \ PS1="[\u@$XBPS_MASTERDIR \W]$ " /bin/bash +h _EOF @@ -119,7 +119,9 @@ chroot_prepare() { # Copy /etc/passwd and /etc/group from base-files. cp -f $XBPS_SRCPKGDIR/base-files/files/passwd $XBPS_MASTERDIR/etc - echo "$(whoami):x:$(id -u):$(id -g):$(whoami) user:/tmp:/bin/xbps-shell" \ + mkdir -p $XBPS_MASTERDIR/tmp/fake-home + chown $(id -u):$(id -g) $XBPS_MASTERDIR/tmp/fake-home + echo "$(whoami):x:$(id -u):$(id -g):$(whoami) user:/tmp/fake-home:/bin/xbps-shell" \ >> $XBPS_MASTERDIR/etc/passwd cp -f $XBPS_SRCPKGDIR/base-files/files/group $XBPS_MASTERDIR/etc echo "$(whoami):x:$(id -g):" >> $XBPS_MASTERDIR/etc/group @@ -166,7 +168,7 @@ chroot_handler() { rv=$? else env -i -- PATH="/usr/bin:$PATH" SHELL=/bin/sh \ - HOME=/tmp IN_CHROOT=1 LC_COLLATE=C LANG=en_US.UTF-8 \ + HOME=/tmp/fake-home IN_CHROOT=1 LC_COLLATE=C LANG=en_US.UTF-8 \ ${HTTP_PROXY:+HTTP_PROXY="${HTTP_PROXY}"} \ ${HTTPS_PROXY:+HTTPS_PROXY="${HTTPS_PROXY}"} \ ${FTP_PROXY:+FTP_PROXY="${FTP_PROXY}"} \