reGen2 Linux Release Metatool
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

ezbuild 2.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  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. -D|--tarballdate)
  21. shift
  22. if [ -z ${1} ]; then
  23. die "--tarballdate requires an additional argument!"
  24. else
  25. TARBALLDATE="${1}"
  26. fi
  27. ;;
  28. -h|--help)
  29. showEzbuildUsage
  30. ;;
  31. -l|--listmods)
  32. listModules
  33. ;;
  34. -p|--purge)
  35. EZOPT_PURGETMP=true
  36. ;;
  37. -P|--purgeonly)
  38. EZOPT_PURGETMP=true
  39. EZOPT_PURGEONLY=true
  40. ;;
  41. -s|--syscheck)
  42. EZOPT_SYSCHECKONLY=true
  43. ;;
  44. -t|--notrigger)
  45. EZOPT_NOTRIGGER=true
  46. ;;
  47. -T|--tarballformat)
  48. shift
  49. if [ -z ${1} ]; then
  50. die "--tarballformat requires an additional argument!"
  51. else
  52. TARBALLFORMAT="${1}"
  53. fi
  54. ;;
  55. *)
  56. die "Unrecognized option ${1}"
  57. ;;
  58. esac
  59. shift
  60. done
  61. # Check system requirements
  62. printInfo "Checking system prerequisites..."
  63. checkPrerequisites
  64. [ ${?} -ne 0 ] && die "Your environment does not meet EzBuild requirements!" 1
  65. if isEnabled ${EZOPT_SYSCHECKONLY}; then
  66. printInfo "Your system meets all EzBuild requirements!"
  67. quit
  68. fi
  69. # Do not allow more than one working copy
  70. PID=$(pidof -s -o '%PPID' -x ${EZNAME})
  71. if [ ${PID} ]; then
  72. printWarn "The ${EZNAME} is already working with PID: ${PID}"
  73. printWarn "You cannot have more than one instancy running"
  74. exit 0
  75. fi
  76. # Optionally purge whole temp directory or log file only
  77. if isEnabled ${EZOPT_PURGETMP}; then
  78. printInfo "Clearing temp directory..."
  79. cleanTemp
  80. if isEnabled ${EZOPT_PURGEONLY}; then
  81. quit
  82. fi
  83. elif isEnabled ${EZOPT_CLEANLOG}; then
  84. printInfo "Clearing log file..."
  85. cleanLog
  86. fi
  87. # Initialize EzBuild environment
  88. makeCoreDirectories || die "EzBuild was unable to create all necessary directories!" 1
  89. EZNOTIFY="yes"
  90. prepareWrappers || die "EzBuild was unable to create a wrapper files!" 1
  91. export LC_ALL="C"
  92. trap 'die "Process killed! This may lead into unexpected problems!"' 1 2 3 9 15 17 18 23
  93. # Load necessary public keys
  94. printInfo "Loading public keys..."
  95. eval `keychain --noask --eval id_dsa id_rsa &> /dev/null`
  96. [ ${?} -ne 0 ] && die "EzBuild was unable to load public keys!" 1