reGen2 Linux Release Metatool
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ezbuild 1.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. #!/bin/bash
  2. # Copyright 2010-2012, Asio Software Technologies
  3. # Distributed under the terms of the GNU General Public License v3
  4. # Declare basic system variables
  5. EZNAME=$(basename ${0})
  6. EZROOT=$(dirname $(readlink -ne ${0}))
  7. # Load necessary files
  8. source /etc/profile
  9. source ${EZROOT}/libraries/common
  10. # Load EzBuild libraries & configuration
  11. loadLibraries
  12. loadConfiguration
  13. # Print EzBuild notice and parse arguments
  14. printNotice
  15. until [[ -z "${1}" ]]; do
  16. case "${1}" in
  17. -c|--cleanlog)
  18. EZOPT_CLEANLOG=true
  19. ;;
  20. -h|--help)
  21. showEzbuildUsage
  22. ;;
  23. -l|--listmods)
  24. listModules
  25. ;;
  26. -p|--purge)
  27. EZOPT_PURGETMP=true
  28. ;;
  29. -P|--purgeonly)
  30. EZOPT_PURGETMP=true
  31. EZOPT_PURGEONLY=true
  32. ;;
  33. -s|--syscheck)
  34. EZOPT_SYSCHECKONLY=true
  35. ;;
  36. *)
  37. die "Unrecognized option ${1}"
  38. ;;
  39. esac
  40. shift
  41. done
  42. # Check system requirements
  43. printInfo "Checking system prerequisites..."
  44. checkPrerequisites
  45. [ ${?} -ne 0 ] && die "Your environment does not meet EzBuild requirements!" 1
  46. if isEnabled ${EZOPT_SYSCHECKONLY}; then
  47. printInfo "Your system meets all EzBuild requirements!"
  48. quit
  49. fi
  50. # Do not allow more than one working copy
  51. PID=$(pidof -s -o '%PPID' -x ${EZNAME})
  52. if [ ${PID} ]; then
  53. printWarn "The ${EZNAME} is already working with PID: ${PID}"
  54. printWarn "You cannot have more than one instancy running"
  55. exit 0
  56. fi
  57. # Optionally purge whole temp directory or log file only
  58. if isEnabled ${EZOPT_PURGETMP}; then
  59. printInfo "Clearing temp directory..."
  60. cleanTemp
  61. if isEnabled ${EZOPT_PURGEONLY}; then
  62. quit
  63. fi
  64. elif isEnabled ${EZOPT_CLEANLOG}; then
  65. printInfo "Clearing log file..."
  66. cleanLog
  67. fi
  68. # Initialize EzBuild environment
  69. makeCoreDirectories || die "EzBuild was unable to create all necessary directories!" 1
  70. EZNOTIFY="yes"
  71. export LC_ALL="C"
  72. trap 'die "Process killed! This may lead into unexpected problems!"' 1 2 3 9 15 17 18 23