util/build-gnu.sh reword error w/o gnu coreutils

For a new contributor, the message given by `utils/build-gnu.sh` is
fairly confusing - it starts with several lines of noise (showing
variables that are set in the script) followed by an error about missing
"GNU" and a `git` command string.

This commit changes the script to explicitly instruct the user to run
the `git clone` command. Since the GNU coreutils repository is probably
missing for new developers, this error is shown if the repository is
missing without including VARIABLE=value lines that are not actionable
yet.
This commit is contained in:
Joseph Jon Booker 2023-06-28 23:10:45 -05:00 committed by Sylvestre Ledru
parent 5c10180f6d
commit 9bf1fb5838

View file

@ -11,28 +11,31 @@ ME="${0}"
ME_dir="$(dirname -- "$(readlink -fm -- "${ME}")")"
REPO_main_dir="$(dirname -- "${ME_dir}")"
echo "ME='${ME}'"
echo "ME_dir='${ME_dir}'"
echo "REPO_main_dir='${REPO_main_dir}'"
### * config (from environment with fallback defaults); note: GNU is expected to be a sibling repo directory
path_UUTILS=${path_UUTILS:-${REPO_main_dir}}
path_GNU="$(readlink -fm -- "${path_GNU:-${path_UUTILS}/../gnu}")"
echo "path_UUTILS='${path_UUTILS}'"
echo "path_GNU='${path_GNU}'"
###
if test ! -d "${path_GNU}"; then
echo "Could not find GNU (expected at '${path_GNU}')"
echo "Could not find GNU coreutils (expected at '${path_GNU}')"
echo "Run the following to download into the expected path:"
echo "git clone --recurse-submodules https://github.com/coreutils/coreutils.git \"${path_GNU}\""
exit 1
fi
###
echo "ME='${ME}'"
echo "ME_dir='${ME_dir}'"
echo "REPO_main_dir='${REPO_main_dir}'"
echo "path_UUTILS='${path_UUTILS}'"
echo "path_GNU='${path_GNU}'"
###
UU_MAKE_PROFILE=${UU_MAKE_PROFILE:-release}
echo "UU_MAKE_PROFILE='${UU_MAKE_PROFILE}'"