Browse Source

Make shell scripts more portable by using /usr/bin/env bash

pull/208/head
Jonathan "Duke" Leto 2 years ago
parent
commit
2a8dbbad7b
  1. 2
      contrib/fresh_clone_compile_and_run.sh
  2. 4
      contrib/gitian-descriptors/gitian-linux.yml
  3. 2
      contrib/gitian-descriptors/gitian-osx-signer.yml
  4. 4
      contrib/gitian-descriptors/gitian-osx.yml
  5. 8
      contrib/gitian-descriptors/gitian-win.yml
  6. 2
      contrib/init/hushd.init
  7. 2
      contrib/snapshot/airdrop_hush3.sh
  8. 2
      contrib/snapshot/testnet_airdrop_hush3.sh
  9. 2
      contrib/tidy_datadir.sh
  10. 2
      contrib/verify-commits/pre-push-hook.sh
  11. 2
      contrib/verify-commits/verify-commits.sh
  12. 2
      contrib/verifysfbinaries/verify.sh
  13. 2
      migratecoin.sh
  14. 2
      qa/hush/checksec.sh
  15. 2
      qa/pull-tester/cc-tests.sh
  16. 2
      qa/pull-tester/rpc-tests.sh
  17. 2
      qa/pull-tester/run-bitcoin-cli
  18. 2
      qa/pull-tester/run-bitcoind-for-test.sh.in
  19. 2
      qa/pull-tester/tests-config.sh.in
  20. 2
      src/assetchains_stop
  21. 2
      src/cc/makecclib
  22. 2
      src/purge
  23. 2
      src/sc/hush
  24. 2
      src/sc/koolaid
  25. 2
      src/sc/kush
  26. 2
      src/sc/zex
  27. 2
      src/smartchains
  28. 2
      src/smartchains.old
  29. 2
      src/tush-cli
  30. 2
      src/zush
  31. 2
      test_randomx
  32. 2
      toolchain-info.sh
  33. 2
      util/build-arm.sh
  34. 2
      util/build-debian-package.sh
  35. 2
      util/build-mac.sh
  36. 2
      util/build-win.sh
  37. 2
      util/docker-entrypoint.sh
  38. 2
      util/docker-hush-cli.sh
  39. 2
      util/gen-linux-binary-release.sh

2
contrib/fresh_clone_compile_and_run.sh

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# Copyright (c) 2016-2022 The Hush developers
# Distributed under the GPLv3 software license, see the accompanying
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html

4
contrib/gitian-descriptors/gitian-linux.yml

@ -53,7 +53,7 @@ script: |
function create_global_faketime_wrappers {
for prog in ${FAKETIME_PROGS}; do
echo '#!/bin/bash' > ${WRAP_DIR}/${prog}
echo '#!/usr/bin/env bash' > ${WRAP_DIR}/${prog}
echo "REAL=\`which -a ${prog} | grep -v ${WRAP_DIR}/${prog} | head -1\`" >> ${WRAP_DIR}/${prog}
echo 'export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/faketime/libfaketime.so.1' >> ${WRAP_DIR}/${prog}
echo "export FAKETIME=\"$1\"" >> ${WRAP_DIR}/${prog}
@ -65,7 +65,7 @@ script: |
function create_per-host_faketime_wrappers {
for i in $HOSTS; do
for prog in ${FAKETIME_HOST_PROGS}; do
echo '#!/bin/bash' > ${WRAP_DIR}/${i}-${prog}
echo '#!/usr/bin/env bash' > ${WRAP_DIR}/${i}-${prog}
echo "REAL=\`which -a ${i}-${prog} | grep -v ${WRAP_DIR}/${i}-${prog} | head -1\`" >> ${WRAP_DIR}/${i}-${prog}
echo 'export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/faketime/libfaketime.so.1' >> ${WRAP_DIR}/${i}-${prog}
echo "export FAKETIME=\"$1\"" >> ${WRAP_DIR}/${i}-${prog}

2
contrib/gitian-descriptors/gitian-osx-signer.yml

@ -20,7 +20,7 @@ script: |
# Create global faketime wrappers
for prog in ${FAKETIME_PROGS}; do
echo '#!/bin/bash' > ${WRAP_DIR}/${prog}
echo '#!/usr/bin/env bash' > ${WRAP_DIR}/${prog}
echo "REAL=\`which -a ${prog} | grep -v ${WRAP_DIR}/${prog} | head -1\`" >> ${WRAP_DIR}/${prog}
echo 'export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/faketime/libfaketime.so.1' >> ${WRAP_DIR}/${prog}
echo "export FAKETIME=\"${REFERENCE_DATETIME}\"" >> ${WRAP_DIR}/${prog}

4
contrib/gitian-descriptors/gitian-osx.yml

@ -48,7 +48,7 @@ script: |
function create_global_faketime_wrappers {
for prog in ${FAKETIME_PROGS}; do
echo '#!/bin/bash' > ${WRAP_DIR}/${prog}
echo '#!/usr/bin/env bash' > ${WRAP_DIR}/${prog}
echo "REAL=\`which -a ${prog} | grep -v ${WRAP_DIR}/${prog} | head -1\`" >> ${WRAP_DIR}/${prog}
echo 'export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/faketime/libfaketime.so.1' >> ${WRAP_DIR}/${prog}
echo "export FAKETIME=\"$1\"" >> ${WRAP_DIR}/${prog}
@ -60,7 +60,7 @@ script: |
function create_per-host_faketime_wrappers {
for i in $HOSTS; do
for prog in ${FAKETIME_HOST_PROGS}; do
echo '#!/bin/bash' > ${WRAP_DIR}/${i}-${prog}
echo '#!/usr/bin/env bash' > ${WRAP_DIR}/${i}-${prog}
echo "REAL=\`which -a ${i}-${prog} | grep -v ${WRAP_DIR}/${i}-${prog} | head -1\`" >> ${WRAP_DIR}/${i}-${prog}
echo 'export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/faketime/libfaketime.so.1' >> ${WRAP_DIR}/${i}-${prog}
echo "export FAKETIME=\"$1\"" >> ${WRAP_DIR}/${i}-${prog}

8
contrib/gitian-descriptors/gitian-win.yml

@ -47,7 +47,7 @@ script: |
function create_global_faketime_wrappers {
for prog in ${FAKETIME_PROGS}; do
echo '#!/bin/bash' > ${WRAP_DIR}/${prog}
echo '#!/usr/bin/env bash' > ${WRAP_DIR}/${prog}
echo "REAL=\`which -a ${prog} | grep -v ${WRAP_DIR}/${prog} | head -1\`" >> ${WRAP_DIR}/${prog}
echo 'export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/faketime/libfaketime.so.1' >> ${WRAP_DIR}/${prog}
echo "export FAKETIME=\"$1\"" >> ${WRAP_DIR}/${prog}
@ -59,7 +59,7 @@ script: |
function create_per-host_faketime_wrappers {
for i in $HOSTS; do
for prog in ${FAKETIME_HOST_PROGS}; do
echo '#!/bin/bash' > ${WRAP_DIR}/${i}-${prog}
echo '#!/usr/bin/env bash' > ${WRAP_DIR}/${i}-${prog}
echo "REAL=\`which -a ${i}-${prog} | grep -v ${WRAP_DIR}/${i}-${prog} | head -1\`" >> ${WRAP_DIR}/${i}-${prog}
echo 'export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/faketime/libfaketime.so.1' >> ${WRAP_DIR}/${i}-${prog}
echo "export FAKETIME=\"$1\"" >> ${WRAP_DIR}/${i}-${prog}
@ -75,14 +75,14 @@ script: |
for i in $HOSTS; do
mkdir -p ${WRAP_DIR}/${i}
for prog in collect2; do
echo '#!/bin/bash' > ${WRAP_DIR}/${i}/${prog}
echo '#!/usr/bin/env bash' > ${WRAP_DIR}/${i}/${prog}
REAL=$(${i}-gcc -print-prog-name=${prog})
echo "export MALLOC_PERTURB_=255" >> ${WRAP_DIR}/${i}/${prog}
echo "${REAL} \$@" >> $WRAP_DIR/${i}/${prog}
chmod +x ${WRAP_DIR}/${i}/${prog}
done
for prog in gcc g++; do
echo '#!/bin/bash' > ${WRAP_DIR}/${i}-${prog}
echo '#!/usr/bin/env bash' > ${WRAP_DIR}/${i}-${prog}
echo "REAL=\`which -a ${i}-${prog} | grep -v ${WRAP_DIR}/${i}-${prog} | head -1\`" >> ${WRAP_DIR}/${i}-${prog}
echo 'export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/faketime/libfaketime.so.1' >> ${WRAP_DIR}/${i}-${prog}
echo "export FAKETIME=\"$1\"" >> ${WRAP_DIR}/${i}-${prog}

2
contrib/init/hushd.init

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
#
# hushd The hush core server.
#

2
contrib/snapshot/airdrop_hush3.sh

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# This code inspired by and dedicated to Decker
echo "Airdropping funds to HUSH3, hold onto your butts..."

2
contrib/snapshot/testnet_airdrop_hush3.sh

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# This code inspired by and dedicated to Decker
echo "Airdropping funds to HUSH3, hold onto your butts..."

2
contrib/tidy_datadir.sh

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# Copyright (c) 2018-2020 The Hush developers
# Distributed under the GPLv3 software license, see the accompanying
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html

2
contrib/verify-commits/pre-push-hook.sh

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# Copyright (c) 2016-2022 The Hush developers
# Distributed under the GPLv3 software license, see the accompanying
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html

2
contrib/verify-commits/verify-commits.sh

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# Copyright (c) 2016-2022 The Hush developers
# Distributed under the GPLv3 software license, see the accompanying
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html

2
contrib/verifysfbinaries/verify.sh

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
### This script attempts to download the signature file SHA256SUMS.asc from bitcoin.org
### It first checks if the signature passes, and then downloads the files specified in

2
migratecoin.sh

@ -1,4 +1,4 @@
#!/usr/bin/bash
#!/usr/usr/bin/env bash
# Copyright (c) 2016-2022 The Hush developers
# Distributed under the GPLv3 software license, see the accompanying
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html

2
qa/hush/checksec.sh

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
#
# The BSD License (http://www.opensource.org/licenses/bsd-license.php)
# specifies the terms and conditions of use for checksec.sh:

2
qa/pull-tester/cc-tests.sh

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
set -e -o pipefail
CURDIR=$(cd $(dirname "$0"); pwd)

2
qa/pull-tester/rpc-tests.sh

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# Copyright (c) 2016-2022 The Hush developers
# Released under the GPLv3

2
qa/pull-tester/run-bitcoin-cli

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# Copyright (c) 2016-2022 The Hush developers
# Released under the GPLv3

2
qa/pull-tester/run-bitcoind-for-test.sh.in

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# THIS FILE IS GENERATED FROM run-bitcoind-for-test.sh.in
# Copyright (c) 2013-2014 The Bitcoin Core developers
# Copyright (c) 2016-2022 The Hush developers

2
qa/pull-tester/tests-config.sh.in

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# THIS FILE IS GENERATED FROM tests-config.sh.in
# Copyright (c) 2013-2014 The Bitcoin Core developers
# Copyright (c) 2016-2022 The Hush developers

2
src/assetchains_stop

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# Copyright (c) 2016-2022 The Hush developers
set -eo pipefail
hush_cli='./hush-cli'

2
src/cc/makecclib

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# Copyright (c) 2016-2022 The Hush developers
# Distributed under the GPLv3 software license, see the accompanying
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html

2
src/purge

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# Copyright (c) 2016-2022 The Hush developers
# Released under the GPLv3

2
src/sc/hush

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# Copyright (c) 2018-2020 The Hush developers
#set working directory to the location of this script
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

2
src/sc/koolaid

@ -1,3 +1,3 @@
#!/bin/bash
#!/usr/bin/env bash
# Copyright (c) 2018-2020 The Hush developers
./hush-smart-chain -ac_name=KOOLAID $@

2
src/sc/kush

@ -1,3 +1,3 @@
#!/bin/bash
#!/usr/bin/env bash
# Copyright (c) 2018-2020 The Hush developers
./hush-smart-chain -ac_name=KUSH $@

2
src/sc/zex

@ -1,3 +1,3 @@
#!/bin/bash
#!/usr/bin/env bash
# Copyright (c) 2018-2020 The Hush developers
./hush-smart-chain -ac_name=ZEX $@

2
src/smartchains

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# Copyright (c) 2018-2022 The Hush developers
set -eo pipefail

2
src/smartchains.old

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# Copyright (c) 2018-2020 The Hush developers
set -x
delay=60

2
src/tush-cli

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# Copyright (c) 2016-2022 The Hush developers
# set working directory to the location of this script

2
src/zush

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# Copyright (c) 2016-2022 The Hush developers
# set working directory to the location of this script

2
test_randomx

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# any CLI args given to this script will be passed along
# example: ./test_randomx -debug=randomx

2
toolchain-info.sh

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# Copyright (c) 2016-2022 The Hush developers
# Distributed under the GPLv3 software license, see the accompanying
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html

2
util/build-arm.sh

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# Copyright (c) 2019-2020 radix42
# Copyright (c) 2016-2022 The Hush developers
# Original aarch64 port by radix42. Thank you!

2
util/build-debian-package.sh

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# Copyright (c) 2016-2022 The Hush developers
# Distributed under the GPLv3 software license, see the accompanying
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html

2
util/build-mac.sh

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# Copyright (c) 2016-2022 The Hush developers
# Distributed under the GPLv3 software license, see the accompanying
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html

2
util/build-win.sh

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# Copyright (c) 2016-2022 The Hush developers
# Distributed under the GPLv3 software license, see the accompanying
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html

2
util/docker-entrypoint.sh

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# Copyright (c) 2016-2022 The Hush developers
# Distributed under the GPLv3 software license, see the accompanying
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html

2
util/docker-hush-cli.sh

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# Copyright (c) 2019-2020 Hush developers
/hush/src/hush-cli $@

2
util/gen-linux-binary-release.sh

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# Copyright (c) 2016-2022 The Hush developers
# Released under the GPLv3

Loading…
Cancel
Save