Skip to content

Commit

Permalink
Merge branch 'maint'
Browse files Browse the repository at this point in the history
* maint:
  Improve error handling
  doc: add shasum to check has on OSX
  • Loading branch information
dgud committed Aug 16, 2024
2 parents 61b1ac5 + 096c279 commit 07e4b38
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 8 deletions.
6 changes: 5 additions & 1 deletion HOWTO/INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
-----------------------------------
Expand Down
13 changes: 7 additions & 6 deletions lib/public_key/src/pubkey_os_cacerts.erl
Original file line number Diff line number Diff line change
Expand Up @@ -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} ->
Expand Down
7 changes: 6 additions & 1 deletion otp_build
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 07e4b38

Please sign in to comment.