Skip to content

Commit 0286051

Browse files
oech3oech3
authored andcommitted
build-gnu.sh: Save time for GnuTests
1 parent c085cd1 commit 0286051

File tree

1 file changed

+14
-15
lines changed

1 file changed

+14
-15
lines changed

util/build-gnu.sh

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -94,29 +94,28 @@ else
9494
fi
9595
cd -
9696

97-
# Pass the feature flags to make, which will pass them to cargo
98-
"${MAKE}" PROFILE="${PROFILE}" SKIP_UTILS=more CARGOFLAGS="${CARGO_FEATURE_FLAGS}"
99-
# min test for SELinux
100-
[ "${SELINUX_ENABLED}" = 1 ] && touch g && "${PROFILE}"/stat -c%C g && rm g
101-
102-
cp "${UU_BUILD_DIR}/install" "${UU_BUILD_DIR}/ginstall" # The GNU tests rename this script before running, to avoid confusion with the make target
103-
# Create *sum binaries
104-
for sum in b2sum md5sum sha1sum sha224sum sha256sum sha384sum sha512sum; do
105-
sum_path="${UU_BUILD_DIR}/${sum}"
106-
test -f "${sum_path}" || (cd ${UU_BUILD_DIR} && ln -s "hashsum" "${sum}")
97+
"${MAKE}" UTILS=install PROFILE="${PROFILE}" CARGOFLAGS="${CARGO_FEATURE_FLAGS}"
98+
ln -vf "${UU_BUILD_DIR}/install" "${UU_BUILD_DIR}/ginstall" # The GNU tests use renamed install to ginstall
99+
if [ "${SELINUX_ENABLED}" = 1 ];then
100+
# Build few utils for faster build
101+
"${MAKE}" MULTICALL=y UTILS="cat chcon cp cut echo env groups id ln ls mkdir mkfifo mknod mktemp mv printf rm rmdir runcon stat test touch tr uname wc whoami" PROFILE="${PROFILE}" CARGOFLAGS="${CARGO_FEATURE_FLAGS}"
102+
# min test for SELinux
103+
touch g && "${PROFILE}"/stat -c%C g && rm g
104+
else
105+
"${MAKE}" MULTICALL=y SKIP_UTILS="install more" PROFILE="${PROFILE}" CARGOFLAGS="${CARGO_FEATURE_FLAGS}"
106+
fi
107+
for binary in $("${UU_BUILD_DIR}"/coreutils --list)
108+
do ln -vf "${UU_BUILD_DIR}/coreutils" "${UU_BUILD_DIR}/${binary}"
107109
done
108-
test -f "${UU_BUILD_DIR}/[" || (cd ${UU_BUILD_DIR} && ln -s "test" "[")
109-
110110
##
111111

112112
cd "${path_GNU}" && echo "[ pwd:'${PWD}' ]"
113113

114-
# Any binaries that aren't built become `false` so their tests fail
114+
echo "Symlinking binaries that aren't built become `false` so their tests fail"
115115
for binary in $(./build-aux/gen-lists-of-programs.sh --list-progs); do
116116
bin_path="${UU_BUILD_DIR}/${binary}"
117117
test -f "${bin_path}" || {
118-
echo "'${binary}' was not built with uutils, using the 'false' program"
119-
cp "${UU_BUILD_DIR}/false" "${bin_path}"
118+
cp -v /usr/bin/false "${bin_path}"
120119
}
121120
done
122121

0 commit comments

Comments
 (0)