Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2020-01-22 16:40:40 +0300
committerCampbell Barton <ideasman42@gmail.com>2020-01-22 16:41:26 +0300
commita90c2834a1f35d97d3a5a96af5486d84aaa8e1ce (patch)
tree0d9197dd08c8b79482b759e756aaaf8ae50e64c9 /build_files
parentfbe25aeed4411e1b7f501f25a7b23c4c0967c6e9 (diff)
install_deps.sh: add debugging options
Add USE_DEBUG_TRAP, USE_DEBUG_LOG for trapping errors and logging executed lines respectively. Handy for troubleshooting issues in the script.
Diffstat (limited to 'build_files')
-rwxr-xr-xbuild_files/build_environment/install_deps.sh23
1 files changed, 23 insertions, 0 deletions
diff --git a/build_files/build_environment/install_deps.sh b/build_files/build_environment/install_deps.sh
index c71b5f1c436..c783c7f2b85 100755
--- a/build_files/build_environment/install_deps.sh
+++ b/build_files/build_environment/install_deps.sh
@@ -19,6 +19,29 @@
# A shell script installing/building all needed dependencies to build Blender, for some Linux distributions.
+##### Debugging Helpers #####
+#
+# Use for developing this script (keep first).
+
+# Useful for debugging this script:
+USE_DEBUG_TRAP=${USE_DEBUG_TRAP:-0}
+USE_DEBUG_LOG=${USE_DEBUG_LOG:-0}
+
+# Print the line that exits.
+if [ $USE_DEBUG_TRAP -ne 0 ]; then
+ err_report() {
+ echo "Error on line $1"
+ exit 1
+ }
+ trap 'err_report $LINENO' ERR
+fi
+
+# Noisy, show every line that runs with it's line number.
+if [ $USE_DEBUG_LOG -ne 0 ]; then
+ PS4='\e[0;33m$(printf %4d ${LINENO}):\e\033[0m '
+ set -x
+fi
+
##### Args and Help Handling #####
# Parse command line!