third_party: Reformat shell scripts
authorAndreas Schneider <asn@samba.org>
Wed, 23 Feb 2022 11:11:07 +0000 (12:11 +0100)
committerPavel Filipensky <pfilipensky@samba.org>
Wed, 10 Aug 2022 14:14:04 +0000 (14:14 +0000)
shfmt -w -p -i 0 -fn third_party/update.sh
shfmt -w -p -i 0 -fn third_party/waf/update.sh

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Pavel Filipenský <pfilipensky@samba.org>
Autobuild-User(master): Pavel Filipensky <pfilipensky@samba.org>
Autobuild-Date(master): Wed Aug 10 14:14:04 UTC 2022 on sn-devel-184

third_party/update.sh
third_party/waf/update.sh

index 7f3581a03e2932c0f2e874467a59b5907e221946..aa40184849b54658a56b766c866552a99bf2445c 100755 (executable)
@@ -3,10 +3,10 @@
 # our source tree for users that don't have them installed on their system
 
 # Third party directory
-THIRD_PARTY_DIR="`dirname $0`"
+THIRD_PARTY_DIR="$(dirname $0)"
 # Library directory where projects live that haven't been migrated to
 # $THIRD_PARTY_DIR yet.
-WORKDIR="`mktemp -d`"
+WORKDIR="$(mktemp -d)"
 
 echo "Updating zlib..."
 git clone git://git.samba.org/third_party/zlib "$WORKDIR/zlib"
index 1983ab0ca6e49353cd16f1f0a659cbfc199c5bc1..45fbeec5eff2a8cb8a62a3c97b4d7d7e0973d944 100755 (executable)
@@ -1,8 +1,8 @@
 #!/bin/bash
 
 if [[ $# -lt 1 ]]; then
-    echo "Usage: update.sh VERSION"
-    exit 1
+       echo "Usage: update.sh VERSION"
+       exit 1
 fi
 
 WAF_VERSION="${1}"
@@ -16,19 +16,21 @@ echo "GIT URL:       ${WAF_GIT}"
 echo "WAF SAMBA DIR: ${WAF_SAMBA_DIR}"
 echo "WAF TMP DIR:    ${WAF_TMPDIR}"
 
-cleanup_tmpdir() {
-    popd 2>/dev/null || true
-    rm -rf "$WAF_TMPDIR"
+cleanup_tmpdir()
+{
+       popd 2>/dev/null || true
+       rm -rf "$WAF_TMPDIR"
 }
 trap cleanup_tmpdir SIGINT
 
-cleanup_and_exit() {
-    cleanup_tmpdir
-    if test "$1" = 0 -o -z "$1" ; then
-        exit 0
-    else
-        exit "$1"
-    fi
+cleanup_and_exit()
+{
+       cleanup_tmpdir
+       if test "$1" = 0 -o -z "$1"; then
+               exit 0
+       else
+               exit "$1"
+       fi
 }
 
 # Checkout the git tree
@@ -38,17 +40,16 @@ pushd "${WAF_TMPDIR}" || cleanup_and_exit 1
 git clone "${WAF_GIT}"
 ret=$?
 if [ $ret -ne 0 ]; then
-    echo "ERROR: Failed to clone repository"
-    cleanup_and_exit 1
+       echo "ERROR: Failed to clone repository"
+       cleanup_and_exit 1
 fi
 
-
 pushd waf || cleanup_and_exit 1
 git checkout -b "waf-${WAF_VERSION}" "waf-${WAF_VERSION}"
 ret=$?
 if [ $ret -ne 0 ]; then
-    echo "ERROR: Failed to checkout waf-${WAF_VERSION} repository"
-    cleanup_and_exit 1
+       echo "ERROR: Failed to checkout waf-${WAF_VERSION} repository"
+       cleanup_and_exit 1
 fi
 popd || cleanup_and_exit 1
 
@@ -62,8 +63,8 @@ rm -rf waflib/
 rsync -av "${WAF_TMPDIR}/waf/waflib" .
 ret=$?
 if [ $ret -ne 0 ]; then
-    echo "ERROR: Failed copy waflib"
-    cleanup_and_exit 1
+       echo "ERROR: Failed copy waflib"
+       cleanup_and_exit 1
 fi
 chmod -x waflib/Context.py