Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] shutils/chroot.sh: move homedir to /tmp/fake-home.
@ 2021-01-09  0:52 olafmersmann
  2021-01-09  1:01 ` [PR PATCH] [Updated] " olafmersmann
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: olafmersmann @ 2021-01-09  0:52 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 558 bytes --]

There is a new pull request by olafmersmann against master on the void-packages repository

https://github.com/olafmersmann/void-packages master
https://github.com/void-linux/void-packages/pull/27779

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.

A patch file from https://github.com/void-linux/void-packages/pull/27779.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-master-27779.patch --]
[-- Type: text/x-diff, Size: 2294 bytes --]

From a11202812449d644db35227b1e012987fd1f3c9f Mon Sep 17 00:00:00 2001
From: Olaf Mersmann <olafm@p-value.net>
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}"} \

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2021-01-09 23:47 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-09  0:52 [PR PATCH] shutils/chroot.sh: move homedir to /tmp/fake-home olafmersmann
2021-01-09  1:01 ` [PR PATCH] [Updated] " olafmersmann
2021-01-09  1:03 ` [PR REVIEW] " ericonr
2021-01-09  1:07 ` [PR PATCH] [Updated] " olafmersmann
2021-01-09  1:07 ` [PR REVIEW] " olafmersmann
2021-01-09  1:08 ` olafmersmann
2021-01-09  1:08 ` ericonr
2021-01-09 23:47 ` [PR PATCH] [Closed]: " olafmersmann
2021-01-09 23:47 ` [PR PATCH] [Updated] " olafmersmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).