From 29cfafa39d25bcdc42ce9667d93a2309b485c6f1 Mon Sep 17 00:00:00 2001 From: Kiko Fernandez-Reyes Date: Fri, 9 Aug 2024 13:40:37 +0200 Subject: [PATCH 1/2] doc: add shasum to check has on OSX adds the dependency `shasum` to check the checksum of ex_doc. this was necessary because OSX does not come with sha256sum nor sha1sum. --- HOWTO/INSTALL.md | 6 +++++- otp_build | 7 ++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/HOWTO/INSTALL.md b/HOWTO/INSTALL.md index 09049e87be59..ecd8b4402023 100644 --- a/HOWTO/INSTALL.md +++ b/HOWTO/INSTALL.md @@ -97,7 +97,11 @@ also find the utilities needed for building the documentation. but any version after that should work just as well. You can also use `./otp_build download_ex_doc` to download the correct version - from github. + from github. One of the following dependencies are needed to check the documentation: + + - sha256sum, or + - sha1sum, or + - shasum How to Build and Install Erlang/OTP ----------------------------------- diff --git a/otp_build b/otp_build index 0ff86b3fde5f..fbb8f42f2a94 100755 --- a/otp_build +++ b/otp_build @@ -1025,8 +1025,13 @@ do_download_ex_doc () echo "The sha1sum check of $ERL_TOP/bin/ex_doc failed!" >&2 exit 1 fi + elif command -v shasum > /dev/null; then + if ! (cd "$ERL_TOP/make" && shasum -a 1 --status -c "ex_doc.sha1sum"); then + echo "The shasum check of $ERL_TOP/bin/ex_doc failed!" >&2 + exit 1 + fi else - echo "Neither sha1sum nor sha256sum found to verify $ERL_TOP/bin/ex_doc" >&2 + echo "Neither sha1sum nor sha256sum nor shasum found to verify $ERL_TOP/bin/ex_doc" >&2 echo "Please check manually that the correct ex_doc was downloaded." >&2 exit 1 fi From f2599b48f092f6d84c6606a2ce849bd69c8b4069 Mon Sep 17 00:00:00 2001 From: Dan Gudmundsson Date: Thu, 15 Aug 2024 09:11:07 +0200 Subject: [PATCH 2/2] Improve error handling Could return undefined if no files where present. --- lib/public_key/src/pubkey_os_cacerts.erl | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/lib/public_key/src/pubkey_os_cacerts.erl b/lib/public_key/src/pubkey_os_cacerts.erl index 2cc028be5f57..6fa5fdb9a669 100644 --- a/lib/public_key/src/pubkey_os_cacerts.erl +++ b/lib/public_key/src/pubkey_os_cacerts.erl @@ -54,19 +54,20 @@ get() -> %% (Re)Load default os cacerts and cache result. -spec load() -> ok | {error, Reason::term()}. load() -> + DefError = {error, no_cacerts_found}, case os:type() of {unix, linux} -> - load(linux_paths(), undefined); + load(linux_paths(), DefError); {unix, openbsd} -> - load(bsd_paths(), undefined); + load(bsd_paths(), DefError); {unix, freebsd} -> - load(bsd_paths(), undefined); + load(bsd_paths(), DefError); {unix, dragonfly} -> - load(bsd_paths(), undefined); + load(bsd_paths(), DefError); {unix, netbsd} -> - load(bsd_paths(), undefined); + load(bsd_paths(), DefError); {unix, sunos} -> - load(sunos_paths(), undefined); + load(sunos_paths(), DefError); {win32, _} -> load_win32(); {unix, darwin} ->