gnu: Add kafs-client
[jackhill/guix/guix.git] / gnu / packages / patches / proot-test-fhs.patch
1 The test suite of PRoot makes many FHS assumptions, such as assuming
2 that /bin, /bin/true, and /usr exist. This patch fixes these assumptions.
3
4 --- source/tests/GNUmakefile 2017-05-11 15:26:36.899115484 +0200
5 +++ source/tests/GNUmakefile 2017-05-11 15:26:46.143063166 +0200
6 @@ -121,7 +121,7 @@ $(ROOTFS_DIR):
7 setup: $(ROOTFS_BIN)
8
9 $(ROOTFS)/bin/abs-true:
10 - @ln -fs /bin/true $@
11 + @ln -fs `which true` $@
12
13 $(ROOTFS)/bin/rel-true:
14 @ln -fs ./true $@
15
16 --- source/tests/test-d2175fc3.sh 2017-05-11 15:36:53.727617010 +0200
17 +++ source/tests/test-d2175fc3.sh 2017-05-11 15:37:10.155523637 +0200
18 @@ -2,8 +2,8 @@ if [ ! -x ${ROOTFS}/bin/readlink ] || [
19 exit 125;
20 fi
21
22 -${PROOT} -r ${ROOTFS} /bin/readlink /bin/abs-true | grep '^/bin/true$'
23 +${PROOT} -r ${ROOTFS} /bin/readlink /bin/abs-true | grep "`which true`"
24 ${PROOT} -r ${ROOTFS} /bin/readlink /bin/rel-true | grep '^\./true$'
25
26 -${PROOT} -b /:/host-rootfs -r ${ROOTFS} /bin/readlink /bin/abs-true | grep '^/bin/true$'
27 +${PROOT} -b /:/host-rootfs -r ${ROOTFS} /bin/readlink /bin/abs-true | grep "`which true`"
28 ${PROOT} -b /:/host-rootfs -r ${ROOTFS} /bin/readlink /bin/rel-true | grep '^./true$'
29
30 --- source/tests/test-d1be631a.sh 2017-05-11 15:41:36.458008715 +0200
31 +++ source/tests/test-d1be631a.sh 2017-05-11 15:41:38.921994686 +0200
32 @@ -1,4 +1,4 @@
33 -if [ -z `which mknod`] || [ `id -u` -eq 0 ]; then
34 +if [ -z `which mknod` ] || [ `id -u` -eq 0 ]; then
35 exit 125;
36 fi
37
38 --- source/tests/test-5bed7141.c 2017-05-11 15:34:23.088472743 +0200
39 +++ source/tests/test-5bed7141.c 2017-05-11 15:34:27.052450235 +0200
40 @@ -80,7 +80,7 @@ int main(int argc, char *argv[])
41 exit(EXIT_FAILURE);
42
43 case 0: /* child */
44 - status = chdir("/usr");
45 + status = chdir("/gnu");
46 if (status < 0) {
47 perror("chdir");
48 exit(EXIT_FAILURE);
49
50 --- a/tests/test-092c5e26.sh
51 +++ b/tests/test-092c5e26.sh
52 @@ -24,7 +24,7 @@ fi
53
54 unset LD_LIBRARY_PATH
55
56 -env PROOT_FORCE_FOREIGN_BINARY=1 PATH=/tmp:/bin:/usr/bin ${PROOT} -r ${ROOTFS} -q echo ${TMP} | grep "^-U LD_LIBRARY_PATH ${EXTRA}-0 /bin/argv0 /bin/argv0 ${TMP_ABS}$"
57 +env PROOT_FORCE_FOREIGN_BINARY=1 PATH=/tmp:/bin:/usr/bin:$(dirname $(which echo)) ${PROOT} -r ${ROOTFS} -q echo ${TMP} | grep "^-U LD_LIBRARY_PATH ${EXTRA}-0 /bin/argv0 /bin/argv0 ${TMP_ABS}$"
58 env PROOT_FORCE_FOREIGN_BINARY=1 ${PROOT} -r ${ROOTFS} -q echo ${TMP_ABS} | grep "^-U LD_LIBRARY_PATH ${EXTRA}-0 /bin/argv0 /bin/argv0 ${TMP_ABS}$"
59
60 cat > ${ROOTFS}/${TMP_ABS} <<EOF
61 @@ -34,7 +34,7 @@ chmod +x ${ROOTFS}/${TMP_ABS}
62
63 # Valgrind prepends "/bin/sh" in front of foreign binaries.
64 if ! $(echo ${PROOT} | grep -q valgrind); then
65 - env PATH=/tmp:/bin:/usr/bin ${PROOT} -r ${ROOTFS} -q echo ${TMP} | grep "^-U LD_LIBRARY_PATH -0 ${TMP} ${TMP_ABS}$"
66 + env PATH=/tmp:/bin:/usr/bin:$(dirname $(which echo)) ${PROOT} -r ${ROOTFS} -q echo ${TMP} | grep "^-U LD_LIBRARY_PATH -0 ${TMP} ${TMP_ABS}$"
67 ${PROOT} -r ${ROOTFS} -q echo ${TMP_ABS} | grep "^-U LD_LIBRARY_PATH -0 ${TMP_ABS} ${TMP_ABS}$"
68 fi
69
70 diff --git a/tests/test-5467b986.sh b/tests/test-5467b986.sh
71 index c6ac71a..f616f1e 100644
72 --- a/tests/test-5467b986.sh
73 +++ b/tests/test-5467b986.sh
74 @@ -30,8 +30,8 @@ ${PROOT} -v -1 -b /tmp:/b -b /tmp:/a -r ${ROOTFS} fchdir_getcwd /b | grep '^/[ab
75 ! ${PROOT} -w /bin -r ${ROOTFS} fchdir_getcwd true
76 [ $? -eq 0 ]
77
78 -${PROOT} -v -1 -w /usr -r / ${ROOTFS}/bin/chdir_getcwd share | grep '^/usr/share$'
79 -${PROOT} -v -1 -w /usr -r / ${ROOTFS}/bin/fchdir_getcwd share | grep '^/usr/share$'
80 +${PROOT} -v -1 -w /gnu -r / ${ROOTFS}/bin/chdir_getcwd store | grep '^/gnu/store$'
81 +${PROOT} -v -1 -w /gnu -r / ${ROOTFS}/bin/fchdir_getcwd store | grep '^/gnu/store$'
82
83 -(cd /; ${PROOT} -v -1 -w usr -r / ${ROOTFS}/bin/chdir_getcwd share | grep '^/usr/share$')
84 -(cd /; ${PROOT} -v -1 -w usr -r / ${ROOTFS}/bin/fchdir_getcwd share | grep '^/usr/share$')
85 +(cd /; ${PROOT} -v -1 -w gnu -r / ${ROOTFS}/bin/chdir_getcwd store | grep '^/gnu/store$')
86 +(cd /; ${PROOT} -v -1 -w gnu -r / ${ROOTFS}/bin/fchdir_getcwd store | grep '^/gnu/store$')
87
88 --- a/tests/test-c15999f9.sh
89 +++ b/tests/test-c15999f9.sh
90 @@ -5,7 +5,7 @@ fi
91 TMP=/tmp/$(mcookie)
92 mkdir ${TMP}
93
94 -${PROOT} -b /bin/true:${TMP}/true /bin/true
95 +${PROOT} -b `which true`:${TMP}/true `which true`
96 ! test -e ${TMP}/true
97 [ $? -eq 0 ]
98