Skip to content

Conversation

@murrayn
Copy link
Contributor

@murrayn murrayn commented Dec 30, 2022

The FreeBSD version of sha256sum takes different arguments than the GNU version.

The sha256_check function in contrib/install_db4.sh has code specific to FreeBSD, however it doesn't get reached because while the sha256sum command does exist on FreeBSD, it is incompatible and results in an error:

sha256sum: option requires an argument -- c
usage: sha256sum [-pqrtx] [-c file] [-s string] [files ...]

This change moves the FreeBSD-specific code before the check for the sha256sum command.

Fixes: #26774

@DrahtBot
Copy link
Contributor

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Reviews

See the guideline for information on the review process.
A summary of reviews will appear here.

@maflcko
Copy link
Member

maflcko commented Dec 30, 2022

No objection, but I wonder if this script can be replaced by a call to compile BDB in depends?

@fanquake
Copy link
Member

No objection, but I wonder if this script can be replaced by a call to compile BDB in depends?

I think this is something we should at some point, and remove install_db4.sh entirely. We have already been removing it's usage.

@maflcko maflcko changed the title script: fix sha256 check in contrib/install_db4.sh for FreeBSD contrib: fix sha256 check in install_db4.sh for FreeBSD Dec 30, 2022
@maflcko maflcko removed the Consensus label Dec 30, 2022
@fanquake fanquake merged commit 4717a5a into bitcoin:master Jan 4, 2023
sidhujag pushed a commit to syscoin/syscoin that referenced this pull request Jan 4, 2023
…FreeBSD

22e9afe use sha256 command instead of sha256sum on FreeBSD (Murray Nesbitt)

Pull request description:

  The FreeBSD version of `sha256sum` takes different arguments than the GNU version.

  The `sha256_check` function in `contrib/install_db4.sh` has code specific to FreeBSD, however it doesn't get reached because while the `sha256sum` command does exist on FreeBSD, it is incompatible and results in an error:

  ```
  sha256sum: option requires an argument -- c
  usage: sha256sum [-pqrtx] [-c file] [-s string] [files ...]
  ```

  This change moves the FreeBSD-specific code before the check for the `sha256sum` command.

  Fixes: bitcoin#26774

Top commit has no ACKs.

Tree-SHA512: 2485e2e7d8fdca3b072b29fb22bbdfd69e520740537b331b33c64cc645b63da712cfa63a23bdf039bbc92a6558fc7bf03323a51784bf601ff360ff0ef59506c8
@murrayn murrayn deleted the freebsd_db4_fix branch February 17, 2023 00:53
@bitcoin bitcoin locked and limited conversation to collaborators Feb 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

contrib/install_db4.sh script fails on FreeBSD

4 participants