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.
 
 
 

186 lines
3.2 KiB

  1. #!/bin/sh
  2. conffile="`mktemp`"
  3. url="http://lol.zoy.org/builds"
  4. append() {
  5. echo "$*" >> "$conffile"
  6. }
  7. #
  8. # Check for command line
  9. #
  10. if [ "$#" != 2 ]; then
  11. echo "Usage: $0 <username> <password>"
  12. exit 1
  13. fi
  14. #
  15. # Operating system information
  16. #
  17. append "[os]"
  18. append "name = `uname -srvmo`"
  19. append "version = 0"
  20. family="`uname -s | tr A-Z a-z`"
  21. case "$family" in
  22. mingw*) family="windows" ;;
  23. darwin*) family="osx" ;;
  24. esac
  25. append "family = $family"
  26. # This random token prevents HTTP conflicts when several instances
  27. # are run from the same machine.
  28. append "token = $$$RANDOM"
  29. append ""
  30. #
  31. # Hardware information
  32. #
  33. append "[machine]"
  34. name="`uname -n | tr A-Z a-z`"
  35. case "$name" in
  36. d*e*s*o*v*) name="putois" ;;
  37. esac
  38. append "name = $name"
  39. processor="`uname -m`"
  40. case "$processor" in
  41. x86_64) processor="amd64" ;;
  42. i*86) processor="i386" ;;
  43. esac
  44. # Windows defines a lot of crazy shit, try to make sense of it
  45. case "$PROCESSOR_ARCHITECTURE" in
  46. amd64|AMD64) processor="amd64" ;;
  47. x86|X86) processor="i386" ;;
  48. esac
  49. case "$PROCESSOR_ARCHITEW6432" in
  50. amd64|AMD64) processor="amd64" ;;
  51. x86|X86) processor="i386" ;;
  52. esac
  53. append "processor = $processor"
  54. append ""
  55. #
  56. # Authentication information
  57. #
  58. append "[authentication]"
  59. append "username = $1"
  60. append "password = $2"
  61. append ""
  62. #
  63. # Visual Studio configuration
  64. #
  65. # FIXME: we also need to check for the Visual Studio SDK
  66. append "[msvc]"
  67. if [ -n "$VS100COMNTOOLS" ]; then
  68. append "version = 10"
  69. elif [ -n "$VS110COMNTOOLS" ]; then
  70. append "version = 11"
  71. elif [ -n "$VS90COMNTOOLS" ]; then
  72. append "version = 9"
  73. fi
  74. append ""
  75. #
  76. # Xbox development kit
  77. #
  78. append "[xdk]"
  79. if [ -n "$XEDK" ]; then
  80. # FIXME: we don't know how to check the version
  81. append "version = 2.0.20675.0"
  82. fi
  83. append ""
  84. #
  85. # PS3 development kit
  86. #
  87. append "[ps3sdk]"
  88. # Try to "detect" the SNC compiler on Windows
  89. if [ -n "$SN_PS3_PATH" ]; then
  90. append "version = 410"
  91. fi
  92. # The setup is easier to detect on Linux
  93. if [ -f "$CELLSDK/version-SDK" ]; then
  94. append "version = $(cat "$CELLSDK/version-SDK")"
  95. fi
  96. append ""
  97. #
  98. # mingw32 / mingw-w64
  99. #
  100. append "[mingw64]"
  101. if x86_64-w64-mingw32-g++ --version >/dev/null 2>&1; then
  102. append "version = $(x86_64-w64-mingw32-g++ --version | sed -ne 's/.*g++ *([^)]*) *//p')"
  103. fi
  104. append ""
  105. append "[mingw32]"
  106. if i686-w64-mingw32-g++ --version >/dev/null 2>&1; then
  107. append "version = $(i686-w64-mingw32-g++ --version | sed -ne 's/.*g++ *([^)]*) *//p')"
  108. fi
  109. append ""
  110. #
  111. # Android NDK
  112. #
  113. append "[ndk]"
  114. if [ -f "$ANDROID_NDK_ROOT/RELEASE.TXT" ]; then
  115. append "version = $(cat "$ANDROID_NDK_ROOT/RELEASE.TXT")"
  116. fi
  117. append ""
  118. #
  119. # Google NaCl SDK
  120. #
  121. append "[pepper]"
  122. if [ -d "$NACL_SDK_ROOT" ]; then
  123. pepper_version=0
  124. for dir in "$NACL_SDK_ROOT/pepper_"*; do
  125. new_version="$(echo "$dir" | sed 's/.*_//')"
  126. if [ "$new_version" -gt "$pepper_version" ]; then
  127. pepper_version="$new_version"
  128. fi
  129. done
  130. if [ "$pepper_version" != 0 ]; then
  131. append "version = $pepper_version"
  132. fi
  133. fi
  134. append ""
  135. #
  136. # Raspberry Pi cross-compiler
  137. #
  138. append "[raspi]"
  139. if [ -d "$RASPI_SDK_ROOT/tools" ]; then
  140. append "version = 0"
  141. fi
  142. append ""
  143. #
  144. # Show what we just did here
  145. #
  146. cat "$conffile"
  147. #
  148. # Launch everything
  149. #
  150. while : ; do
  151. bitten-slave "$url" -f "$conffile" --name "$name"
  152. sleep 10
  153. done
  154. rm -f "$conffile"