Cleanup: use 2 space indentation for shell scripts
authorCampbell Barton <ideasman42@gmail.com>
Wed, 17 Apr 2019 04:08:01 +0000 (06:08 +0200)
committerCampbell Barton <ideasman42@gmail.com>
Wed, 17 Apr 2019 04:08:01 +0000 (06:08 +0200)
Already used by install_deps.sh

build_files/utils/build_tgz.sh
doc/python_api/sphinx_doc_gen.sh

index 203e58d..63c3264 100755 (executable)
@@ -12,11 +12,11 @@ blender_version_cycle=$(grep "BLENDER_VERSION_CYCLE\s" "$blender_srcdir/source/b
 blender_subversion=$(grep "BLENDER_SUBVERSION\s" "$blender_srcdir/source/blender/blenkernel/BKE_blender_version.h" | awk '{print $3}')
 
 if [ "$blender_version_cycle" = "release" ] ; then
 blender_subversion=$(grep "BLENDER_SUBVERSION\s" "$blender_srcdir/source/blender/blenkernel/BKE_blender_version.h" | awk '{print $3}')
 
 if [ "$blender_version_cycle" = "release" ] ; then
-       VERSION=$(expr $blender_version / 100).$(expr $blender_version % 100)$blender_version_char
-       SUBMODULE_EXCLUDE="^\(release/scripts/addons_contrib\)$"
+  VERSION=$(expr $blender_version / 100).$(expr $blender_version % 100)$blender_version_char
+  SUBMODULE_EXCLUDE="^\(release/scripts/addons_contrib\)$"
 else
 else
-       VERSION=$(expr $blender_version / 100).$(expr $blender_version % 100)_$blender_subversion
-       SUBMODULE_EXCLUDE="^$"  # dummy regex
+  VERSION=$(expr $blender_version / 100).$(expr $blender_version % 100)_$blender_subversion
+  SUBMODULE_EXCLUDE="^$"  # dummy regex
 fi
 
 MANIFEST="blender-$VERSION-manifest.txt"
 fi
 
 MANIFEST="blender-$VERSION-manifest.txt"
@@ -42,10 +42,10 @@ git ls-files | python3 -c "$FILTER_FILES_PY" > $BASE_DIR/$MANIFEST
 
 # Enumerate submodules
 for lcv in $(git submodule | awk '{print $2}' | grep -v "$SUBMODULE_EXCLUDE"); do
 
 # Enumerate submodules
 for lcv in $(git submodule | awk '{print $2}' | grep -v "$SUBMODULE_EXCLUDE"); do
-       cd "$BASE_DIR"
-       cd "$blender_srcdir/$lcv"
-       git ls-files | python3 -c "$FILTER_FILES_PY" | awk '$0="'"$lcv"/'"$0' >> $BASE_DIR/$MANIFEST
-       cd "$BASE_DIR"
+  cd "$BASE_DIR"
+  cd "$blender_srcdir/$lcv"
+  git ls-files | python3 -c "$FILTER_FILES_PY" | awk '$0="'"$lcv"/'"$0' >> $BASE_DIR/$MANIFEST
+  cd "$BASE_DIR"
 done
 echo "OK"
 
 done
 echo "OK"
 
@@ -54,10 +54,10 @@ echo "OK"
 cd "$blender_srcdir"
 echo -n "Creating archive:            \"$BASE_DIR/$TARBALL\" ..."
 tar --transform "s,^,blender-$VERSION/,g" \
 cd "$blender_srcdir"
 echo -n "Creating archive:            \"$BASE_DIR/$TARBALL\" ..."
 tar --transform "s,^,blender-$VERSION/,g" \
-       --use-compress-program="gzip --best" \
-       --create \
-       --file="$BASE_DIR/$TARBALL" \
-       --files-from="$BASE_DIR/$MANIFEST"
+  --use-compress-program="gzip --best" \
+  --create \
+  --file="$BASE_DIR/$TARBALL" \
+  --files-from="$BASE_DIR/$MANIFEST"
 echo "OK"
 
 
 echo "OK"
 
 
index 4b7569f..45cd6a2 100755 (executable)
@@ -14,16 +14,16 @@ DO_OUT_HTML_ZIP=true
 DO_OUT_PDF=false
 
 if [ -z $BLENDER_BIN ] ; then
 DO_OUT_PDF=false
 
 if [ -z $BLENDER_BIN ] ; then
-       BLENDER_BIN="./blender.bin"
+  BLENDER_BIN="./blender.bin"
 fi
 
 if [ "$1" == "" ] ; then
 fi
 
 if [ "$1" == "" ] ; then
-       echo "Expected a single argument for the username on blender.org, skipping upload step!"
-       DO_UPLOAD=false
+  echo "Expected a single argument for the username on blender.org, skipping upload step!"
+  DO_UPLOAD=false
 else
 else
-       SSH_USER=$1
-       SSH_HOST=$SSH_USER"@blender.org"
-       SSH_UPLOAD="/data/www/vhosts/www.blender.org/api" # blender_python_api_VERSION, added after
+  SSH_USER=$1
+  SSH_HOST=$SSH_USER"@blender.org"
+  SSH_UPLOAD="/data/www/vhosts/www.blender.org/api" # blender_python_api_VERSION, added after
 fi
 
 
 fi
 
 
@@ -42,9 +42,9 @@ blender_subversion=$(grep "BLENDER_SUBVERSION\s" "$blender_version_header" | awk
 unset blender_version_header
 
 if [ "$blender_version_cycle" = "release" ] ; then
 unset blender_version_header
 
 if [ "$blender_version_cycle" = "release" ] ; then
-       BLENDER_VERSION=$(expr $blender_version / 100)_$(expr $blender_version % 100)$blender_version_char"_release"
+  BLENDER_VERSION=$(expr $blender_version / 100)_$(expr $blender_version % 100)$blender_version_char"_release"
 else
 else
-       BLENDER_VERSION=$(expr $blender_version / 100)_$(expr $blender_version % 100)_$blender_subversion
+  BLENDER_VERSION=$(expr $blender_version / 100)_$(expr $blender_version % 100)_$blender_subversion
 fi
 
 SSH_UPLOAD_FULL=$SSH_UPLOAD/"blender_python_api_"$BLENDER_VERSION
 fi
 
 SSH_UPLOAD_FULL=$SSH_UPLOAD/"blender_python_api_"$BLENDER_VERSION
@@ -58,54 +58,54 @@ SPHINX_WORKDIR="$(mktemp --directory --suffix=.sphinx)"
 # Generate reStructuredText (blender/python only)
 
 if $DO_EXE_BLENDER ; then
 # Generate reStructuredText (blender/python only)
 
 if $DO_EXE_BLENDER ; then
-       # Don't delete existing docs, now partial updates are used for quick builds.
-       #
-       # Disable ASAN error halt since it results in nonzero exit code on any minor issue.
-       ASAN_OPTIONS=halt_on_error=0 \
-       $BLENDER_BIN \
-               --background \
-               -noaudio \
-               --factory-startup \
-               --python-exit-code 1 \
-               --python $SPHINXBASE/sphinx_doc_gen.py \
-               -- \
-               --output=$SPHINX_WORKDIR
-
-
-       if (($? != 0)) ; then
-               echo "Generating documentation failed, aborting"
-               exit 1
-       fi
+  # Don't delete existing docs, now partial updates are used for quick builds.
+  #
+  # Disable ASAN error halt since it results in nonzero exit code on any minor issue.
+  ASAN_OPTIONS=halt_on_error=0 \
+  $BLENDER_BIN \
+    --background \
+    -noaudio \
+    --factory-startup \
+    --python-exit-code 1 \
+    --python $SPHINXBASE/sphinx_doc_gen.py \
+    -- \
+    --output=$SPHINX_WORKDIR
+
+
+  if (($? != 0)) ; then
+    echo "Generating documentation failed, aborting"
+    exit 1
+  fi
 fi
 
 # ----------------------------------------------------------------------------
 # Generate HTML (sphinx)
 
 if $DO_OUT_HTML ; then
 fi
 
 # ----------------------------------------------------------------------------
 # Generate HTML (sphinx)
 
 if $DO_OUT_HTML ; then
-       # sphinx-build -n -b html $SPHINX_WORKDIR/sphinx-in $SPHINX_WORKDIR/sphinx-out
+  # sphinx-build -n -b html $SPHINX_WORKDIR/sphinx-in $SPHINX_WORKDIR/sphinx-out
 
 
-       # annoying bug in sphinx makes it very slow unless we do this. should report.
-       cd $SPHINX_WORKDIR
-       sphinx-build -b html sphinx-in sphinx-out
+  # annoying bug in sphinx makes it very slow unless we do this. should report.
+  cd $SPHINX_WORKDIR
+  sphinx-build -b html sphinx-in sphinx-out
 
 
-       # XXX, saves space on upload and zip, should move HTML outside
-       # and zip up there, for now this is OK
-       rm -rf sphinx-out/.doctrees
+  # XXX, saves space on upload and zip, should move HTML outside
+  # and zip up there, for now this is OK
+  rm -rf sphinx-out/.doctrees
 
 
-       # in case we have a zip already
-       rm -f blender_python_reference_$BLENDER_VERSION.zip
+  # in case we have a zip already
+  rm -f blender_python_reference_$BLENDER_VERSION.zip
 
 
-       # ------------------------------------------------------------------------
-       # ZIP the HTML dir for upload
+  # ------------------------------------------------------------------------
+  # ZIP the HTML dir for upload
 
 
-       if $DO_OUT_HTML_ZIP ; then
-               # lame, temp rename dir
-               mv sphinx-out blender_python_reference_$BLENDER_VERSION
-               zip -r -9 blender_python_reference_$BLENDER_VERSION.zip blender_python_reference_$BLENDER_VERSION
-               mv blender_python_reference_$BLENDER_VERSION sphinx-out
-       fi
+  if $DO_OUT_HTML_ZIP ; then
+    # lame, temp rename dir
+    mv sphinx-out blender_python_reference_$BLENDER_VERSION
+    zip -r -9 blender_python_reference_$BLENDER_VERSION.zip blender_python_reference_$BLENDER_VERSION
+    mv blender_python_reference_$BLENDER_VERSION sphinx-out
+  fi
 
 
-       cd -
+  cd -
 fi
 
 
 fi
 
 
@@ -113,11 +113,11 @@ fi
 # Generate PDF (sphinx/laytex)
 
 if $DO_OUT_PDF ; then
 # Generate PDF (sphinx/laytex)
 
 if $DO_OUT_PDF ; then
-       cd $SPHINX_WORKDIR
-       sphinx-build -n -b latex $SPHINX_WORKDIR/sphinx-in $SPHINX_WORKDIR/sphinx-out
-       make -C $SPHINX_WORKDIR/sphinx-out
-       mv $SPHINX_WORKDIR/sphinx-out/contents.pdf \
-          $SPHINX_WORKDIR/sphinx-out/blender_python_reference_$BLENDER_VERSION.pdf
+  cd $SPHINX_WORKDIR
+  sphinx-build -n -b latex $SPHINX_WORKDIR/sphinx-in $SPHINX_WORKDIR/sphinx-out
+  make -C $SPHINX_WORKDIR/sphinx-out
+  mv $SPHINX_WORKDIR/sphinx-out/contents.pdf \
+     $SPHINX_WORKDIR/sphinx-out/blender_python_reference_$BLENDER_VERSION.pdf
 fi
 
 # ----------------------------------------------------------------------------
 fi
 
 # ----------------------------------------------------------------------------
@@ -125,35 +125,35 @@ fi
 
 if $DO_UPLOAD ; then
 
 
 if $DO_UPLOAD ; then
 
-       ssh $SSH_USER@blender.org 'rm -rf '$SSH_UPLOAD_FULL'/*'
-       rsync --progress -ave "ssh -p 22" $SPHINX_WORKDIR/sphinx-out/* $SSH_HOST:$SSH_UPLOAD_FULL/
-
-       ## symlink the dir to a static URL
-       #ssh $SSH_USER@blender.org 'rm '$SSH_UPLOAD'/250PythonDoc && ln -s '$SSH_UPLOAD_FULL' '$SSH_UPLOAD'/250PythonDoc'
-       if [ "$blender_version_cycle" = "release" ] ; then
-               ssh $SSH_USER@blender.org 'rm '$SSH_UPLOAD'/blender_python_api_current && ln -s '$SSH_UPLOAD_FULL' '$SSH_UPLOAD'/blender_python_api_current'
-       fi
-
-       # better redirect
-       ssh $SSH_USER@blender.org 'echo "<html><head><title>Redirecting...</title><meta http-equiv=\"REFRESH\" content=\"0;url=../blender_python_api_'$BLENDER_VERSION'/\"></head><body>Redirecting...</body></html>" > '$SSH_UPLOAD'/250PythonDoc/index.html'
-
-       # redirect for release only so wiki can point here
-       if [ "$blender_version_cycle" = "release" ] ; then
-               ssh $SSH_USER@blender.org 'echo "<html><head><title>Redirecting...</title><meta http-equiv=\"REFRESH\" content=\"0;url=../blender_python_api_'$BLENDER_VERSION'/\"></head><body>Redirecting...</body></html>" > '$SSH_UPLOAD'/blender_python_api/index.html'
-       fi
-
-       if $DO_OUT_PDF ; then
-               # rename so local PDF has matching name.
-               rsync --progress -ave "ssh -p 22" \
-                     $SPHINX_WORKDIR/sphinx-out/blender_python_reference_$BLENDER_VERSION.pdf \
-                     $SSH_HOST:$SSH_UPLOAD_FULL/blender_python_reference_$BLENDER_VERSION.pdf
-       fi
-
-       if $DO_OUT_HTML_ZIP ; then
-               rsync --progress -ave "ssh -p 22" \
-                     $SPHINX_WORKDIR/blender_python_reference_$BLENDER_VERSION.zip \
-                     $SSH_HOST:$SSH_UPLOAD_FULL/blender_python_reference_$BLENDER_VERSION.zip
-       fi
+  ssh $SSH_USER@blender.org 'rm -rf '$SSH_UPLOAD_FULL'/*'
+  rsync --progress -ave "ssh -p 22" $SPHINX_WORKDIR/sphinx-out/* $SSH_HOST:$SSH_UPLOAD_FULL/
+
+  ## symlink the dir to a static URL
+  #ssh $SSH_USER@blender.org 'rm '$SSH_UPLOAD'/250PythonDoc && ln -s '$SSH_UPLOAD_FULL' '$SSH_UPLOAD'/250PythonDoc'
+  if [ "$blender_version_cycle" = "release" ] ; then
+    ssh $SSH_USER@blender.org 'rm '$SSH_UPLOAD'/blender_python_api_current && ln -s '$SSH_UPLOAD_FULL' '$SSH_UPLOAD'/blender_python_api_current'
+  fi
+
+  # better redirect
+  ssh $SSH_USER@blender.org 'echo "<html><head><title>Redirecting...</title><meta http-equiv=\"REFRESH\" content=\"0;url=../blender_python_api_'$BLENDER_VERSION'/\"></head><body>Redirecting...</body></html>" > '$SSH_UPLOAD'/250PythonDoc/index.html'
+
+  # redirect for release only so wiki can point here
+  if [ "$blender_version_cycle" = "release" ] ; then
+    ssh $SSH_USER@blender.org 'echo "<html><head><title>Redirecting...</title><meta http-equiv=\"REFRESH\" content=\"0;url=../blender_python_api_'$BLENDER_VERSION'/\"></head><body>Redirecting...</body></html>" > '$SSH_UPLOAD'/blender_python_api/index.html'
+  fi
+
+  if $DO_OUT_PDF ; then
+    # rename so local PDF has matching name.
+    rsync --progress -ave "ssh -p 22" \
+          $SPHINX_WORKDIR/sphinx-out/blender_python_reference_$BLENDER_VERSION.pdf \
+          $SSH_HOST:$SSH_UPLOAD_FULL/blender_python_reference_$BLENDER_VERSION.pdf
+  fi
+
+  if $DO_OUT_HTML_ZIP ; then
+    rsync --progress -ave "ssh -p 22" \
+          $SPHINX_WORKDIR/blender_python_reference_$BLENDER_VERSION.zip \
+          $SSH_HOST:$SSH_UPLOAD_FULL/blender_python_reference_$BLENDER_VERSION.zip
+  fi
 
 fi
 
 
 fi