build_support_linux.sh 931 B

123456789101112131415161718192021222324252627282930313233
  1. #!/bin/bash
  2. ##############################################################################
  3. # Linux support functions
  4. ##############################################################################
  5. #
  6. # This script file can be included in build scripts for Linux.
  7. #
  8. ##############################################################################
  9. # Setup build environment
  10. CI_OBS_VERSION=$(cat "${CI_WORKFLOW}" | sed -En "s/[ ]+OBS_VERSION: '([0-9\.]+)'/\1/p")
  11. if [ "${TERM-}" -a -z "${CI}" ]; then
  12. COLOR_RED=$(tput setaf 1)
  13. COLOR_GREEN=$(tput setaf 2)
  14. COLOR_BLUE=$(tput setaf 4)
  15. COLOR_ORANGE=$(tput setaf 3)
  16. COLOR_RESET=$(tput sgr0)
  17. else
  18. COLOR_RED=""
  19. COLOR_GREEN=""
  20. COLOR_BLUE=""
  21. COLOR_ORANGE=""
  22. COLOR_RESET=""
  23. fi
  24. if [ "${CI}" -o "${QUIET}" ]; then
  25. export CURLCMD="curl --silent --show-error --location -O"
  26. else
  27. export CURLCMD="curl --progress-bar --location --continue-at - -O"
  28. fi