選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

195 行
3.6 KiB

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