From 1cab2e54e1b653fe4bfafcde0f6c3d38a6d20899 Mon Sep 17 00:00:00 2001 From: Tim Schumacher Date: Tue, 15 Mar 2022 13:36:51 +0100 Subject: [PATCH] Ports: Fail if config.{sub,guess} don't replace existing files This should help with finding misconfigured config.sub and config.guess settings. --- Ports/.port_include.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Ports/.port_include.sh b/Ports/.port_include.sh index 0386bee8d2..8248485e9d 100755 --- a/Ports/.port_include.sh +++ b/Ports/.port_include.sh @@ -119,6 +119,10 @@ run_replace_in_file() { get_new_config_sub() { config_sub="${1:-config.sub}" + if [ ! -f "$workdir/$config_sub" ]; then + >&2 echo "Error: Downloaded $config_sub does not replace an existing file!" + exit 1 + fi if ! run grep -q serenity "$config_sub"; then run do_download_file "https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub" "${1:-config.sub}" false fi @@ -126,6 +130,10 @@ get_new_config_sub() { get_new_config_guess() { config_guess="${1:-config.guess}" + if [ ! -f "$workdir/$config_guess" ]; then + >&2 echo "Error: Downloaded $config_guess does not replace an existing file!" + exit 1 + fi if ! run grep -q SerenityOS "$config_guess"; then run do_download_file "https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess" "${1:-config_guess}" false fi