|
91 | 91 | export CARGOFLAGS # tell to make |
92 | 92 | if [ "${SELINUX_ENABLED}" = 1 ];then |
93 | 93 | # Build few utils for SELinux for faster build. MULTICALL=y fails... |
94 | | - make UTILS="cat chcon chmod cp cut dd echo env groups id install ln ls mkdir mkfifo mknod mktemp mv printf rm rmdir runcon seq stat test touch tr true uname wc whoami" |
| 94 | + UTILS="cat chcon chmod cp cut dd echo env groups id install ln ls mkdir mkfifo mknod mktemp mv printf rm rmdir runcon seq stat test touch tr true uname wc whoami" |
| 95 | + export UTILS |
| 96 | + make |
95 | 97 | else |
96 | 98 | # Use MULTICALL=y for faster build |
97 | 99 | make MULTICALL=y SKIP_UTILS=more |
98 | | - for binary in $("${UU_BUILD_DIR}"/coreutils --list) |
99 | | - do [ -e "${UU_BUILD_DIR}/${binary}" ] || ln -vf "${UU_BUILD_DIR}/coreutils" "${UU_BUILD_DIR}/${binary}" |
| 100 | + UTILS=$("${UU_BUILD_DIR}"/coreutils --list) |
| 101 | + for binary in ${UTILS} |
| 102 | + do ln -sf "${UU_BUILD_DIR}/coreutils" "${UU_BUILD_DIR}/${binary}" |
100 | 103 | done |
101 | 104 | fi |
102 | | -[ -e "${UU_BUILD_DIR}/ginstall" ] || ln -vf "${UU_BUILD_DIR}/install" "${UU_BUILD_DIR}/ginstall" # The GNU tests use ginstall |
| 105 | +ln -sf "${UU_BUILD_DIR}/install" "${UU_BUILD_DIR}/ginstall" # The GNU tests use ginstall |
103 | 106 | ## |
104 | 107 |
|
105 | 108 | cd "${path_GNU}" && echo "[ pwd:'${PWD}' ]" |
106 | 109 |
|
107 | 110 | # Any binaries that aren't built become `false` to make tests failure |
108 | 111 | for binary in $(./build-aux/gen-lists-of-programs.sh --list-progs); do |
109 | 112 | bin_path="${UU_BUILD_DIR}/${binary}" |
110 | | - test -f "${bin_path}" || cp -v /usr/bin/false "${bin_path}" |
| 113 | + test -f "${bin_path}" || ln -sv /usr/bin/false "${bin_path}" |
111 | 114 | done |
112 | 115 |
|
113 | | -# Always update the PATH to test the uutils coreutils instead of the GNU coreutils |
114 | | -# This ensures the correct path is used even if the repository was moved or rebuilt in a different location |
115 | | -sed -i "s/^[[:blank:]]*PATH=.*/ PATH='${UU_BUILD_DIR//\//\\/}\$(PATH_SEPARATOR)'\"\$\$PATH\" \\\/" tests/local.mk |
116 | | - |
117 | 116 | if test -f gnu-built; then |
118 | 117 | echo "GNU build already found. Skip" |
119 | 118 | echo "'rm -f $(pwd)/{gnu-built,src/getlimits}' to force the build" |
@@ -160,6 +159,11 @@ else |
160 | 159 | touch gnu-built |
161 | 160 | fi |
162 | 161 |
|
| 162 | +# Hijack coreutils |
| 163 | +for binary in ${UTILS} |
| 164 | + do ln -sf "${UU_BUILD_DIR}/${binary}" src/"${binary}" |
| 165 | +done |
| 166 | + |
163 | 167 | grep -rl 'path_prepend_' tests/* | xargs -r "${SED}" -i 's| path_prepend_ ./src||' |
164 | 168 | # path_prepend_ sets $abs_path_dir_: set it manually instead. |
165 | 169 | grep -rl '\$abs_path_dir_' tests/*/*.sh | xargs -r "${SED}" -i "s|\$abs_path_dir_|${UU_BUILD_DIR//\//\\/}|g" |
|
0 commit comments