No description provided.
contrib/install_db4.sh: http_get if tar.gz does not exist #23449
pull RandyMcMillan wants to merge 1 commits into bitcoin:master from RandyMcMillan:install-db4-check changing 1 files +3 −1-
RandyMcMillan commented at 2:40 AM on November 6, 2021: contributor
-
RandyMcMillan commented at 2:41 AM on November 6, 2021: contributor
./contrib/install_db4.sh `pwd`fails if db-4.8.30.NC.tar.gz exists
- RandyMcMillan force-pushed on Nov 6, 2021
- RandyMcMillan force-pushed on Nov 6, 2021
- RandyMcMillan force-pushed on Nov 6, 2021
- RandyMcMillan force-pushed on Nov 6, 2021
- RandyMcMillan force-pushed on Nov 6, 2021
- DrahtBot added the label Scripts and tools on Nov 6, 2021
-
lsilva01 commented at 4:15 AM on November 6, 2021: contributor
Concept ACK
-
in contrib/install_db4.sh:67 in c85909a3fe outdated
62 | @@ -63,8 +63,12 @@ http_get() { 63 | } 64 | 65 | mkdir -p "${BDB_PREFIX}" 66 | -http_get "${BDB_URL}" "${BDB_VERSION}.tar.gz" "${BDB_HASH}" 67 | -tar -xzvf ${BDB_VERSION}.tar.gz -C "$BDB_PREFIX" 68 | +if [ -f "${BDB_VERSION}.tar.gz" ]; then 69 | + tar -xzvf ${BDB_VERSION}.tar.gz -C "$BDB_PREFIX"
MarcoFalke commented at 8:57 AM on November 6, 2021:So this will skip the BDB_HASH check?
katesalazar commented at 4:16 PM on November 6, 2021: contributor./contrib/install_db4.sh `pwd`fails if db-4.8.30.NC.tar.gz exists
Then there is something wrong in lines 54 and 55, right?
The fix would be in those two lines, not out of the scope of http_get.
How does it fail exactly?
contrib/install_db4.sh: http_get if tar.gz does not exist 2d25426e8ein contrib/install_db4.sh:66 in c85909a3fe outdated
62 | @@ -63,8 +63,12 @@ http_get() { 63 | } 64 | 65 | mkdir -p "${BDB_PREFIX}" 66 | -http_get "${BDB_URL}" "${BDB_VERSION}.tar.gz" "${BDB_HASH}" 67 | -tar -xzvf ${BDB_VERSION}.tar.gz -C "$BDB_PREFIX" 68 | +if [ -f "${BDB_VERSION}.tar.gz" ]; then
laanwj commented at 11:21 AM on November 8, 2021:For the current logic it would imo be better to write it as a negation so that the
tarcan be factored out:if [ ! -f "${BDB_VERSION}.tar.gz" ]; then http_get "${BDB_URL}" "${BDB_VERSION}.tar.gz" "${BDB_HASH}" fi tar -xzvf ${BDB_VERSION}.tar.gz -C "$BDB_PREFIX"I agree that checking the hash would make (some) sense even if the file exists, though.
katesalazar commented at 7:55 PM on November 8, 2021:For the current logic it would imo be better to write it as a negation so that the
tarcan be factored out:if [ ! -f "${BDB_VERSION}.tar.gz" ]; then http_get "${BDB_URL}" "${BDB_VERSION}.tar.gz" "${BDB_HASH}" fi tar -xzvf ${BDB_VERSION}.tar.gz -C "$BDB_PREFIX"That suggestion is good if http_get exits upon failure.
You are not proposing any error control on the tar exit status, are you? It would fail if http_get fails what is supposed to do.
RandyMcMillan commented at 7:43 AM on November 9, 2021:changed to
if not existlogicRandyMcMillan force-pushed on Nov 9, 2021RandyMcMillan renamed this:contrib/install_db4.sh: check if tar exists
contrib/install_db4.sh: check if tar.gz does not exist
on Nov 9, 2021RandyMcMillan renamed this:contrib/install_db4.sh: check if tar.gz does not exist
contrib/install_db4.sh: http_get if tar.gz does not exist
on Nov 9, 2021jamesob commented at 3:22 PM on November 9, 2021: memberI don't understand - isn't the existing file case already covered in
http_get? https://github.com/bitcoin/bitcoin/blob/master/contrib/install_db4.sh#L54-L55katesalazar commented at 3:50 PM on November 9, 2021: contributorMore generally, could only apply tar extraction unconditionally if http_get performs an infinite loop broken when the file is downloaded, not only downloaded but until sha256_check is satisfactory as well, keeping trying new downloads on corrupted download or unexpected content.
Or do http_get and sha256_check abort the whole script when returning unsuccessfully?
RandyMcMillan marked this as a draft on Nov 9, 2021RandyMcMillan commented at 5:05 PM on November 9, 2021: contributorClosed - Maybe there was an anomily with MacOS M1 bash shell or the download was being corrupted (thru a vpn).
RandyMcMillan closed this on Nov 9, 2021DrahtBot locked this on Nov 9, 2022Labels
This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-17 15:14 UTC
More mirrored repositories can be found on mirror.b10c.me