mirror of the now-defunct rocklinux.org
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.

103 lines
2.4 KiB

  1. #!/bin/bash
  2. usage() {
  3. cat <<EOF
  4. $0: commit build results into ROCK Sonar
  5. Usage:
  6. $0 <config> [ <config> ... ]
  7. EOF
  8. exit 1;
  9. }
  10. confirm() {
  11. unset yesno
  12. while [ "${yesno}" != "yes" -a "${yesno}" != "no" ] ; do
  13. echo -n "${@} [yes|no] ? "
  14. read yesno
  15. done
  16. [ "${yesno}" = "yes" ] && return 0
  17. return 1
  18. }
  19. commit(){
  20. . scripts/parse-config
  21. . config/${1}/config
  22. . config/${1}/config_usr
  23. if [ ! -d "build/${ROCKCFG_ID}/var/adm" ] ; then
  24. echo "Directory does not exist: build/${ROCKCFG_ID}/var/adm" >&2
  25. echo "Did you run Build-Target for this configuration?" >&2
  26. return 1
  27. fi
  28. echo "ROCK Version is: ${rockver}"
  29. revision="`svn info | grep Revision | cut -f2 -d' ' 2>&1`"
  30. echo "Subversion revision is: ${revision}"
  31. target="${ROCKCFG_TARGET}";
  32. echo "Target is: ${target}"
  33. echo "Please enter a description (for example: \"personal tree 2004-12-02\"):"
  34. read description
  35. echo "Please enter a comment: (for example: \"optimised for Pentium MMX\"):"
  36. read comment
  37. finished=0
  38. while [ ${finished} -eq 0 ] ; do
  39. echo "ROCK Version: ${rockver}"
  40. echo "Revision : ${revision}"
  41. echo "Target : ${target}"
  42. echo "Description : ${description}"
  43. echo "Comment : ${comment}"
  44. if confirm "Are these values correct?" ; then
  45. finished=1
  46. continue
  47. fi
  48. read -p "ROCK Version [${rockver}]: " tmp
  49. [ -n "${tmp}" ] && rockver="${tmp}"
  50. unset tmp
  51. read -p "Revision [${revision}]: " tmp
  52. [ -n "${tmp}" ] && revision="${tmp}"
  53. unset tmp
  54. read -p "Target [${target}]: " tmp
  55. [ -n "${tmp}" ] && target="${tmp}"
  56. unset tmp
  57. read -p "Description [${description}]: " tmp
  58. [ -n "${tmp}" ] && description="${tmp}"
  59. unset tmp
  60. read -p "Comment [${comment}]: " tmp
  61. [ -n "${tmp}" ] && comment="${tmp}"
  62. unset tmp
  63. done
  64. echo -n "Creating varadm.tar.bz2 ... "
  65. cd build/${ROCKCFG_ID}/var/
  66. tar --use-compress-program=bzip2 -cf varadm.tar.bz2 adm/{dependencies,descs,flists}
  67. echo "done"
  68. echo -n "Uploading to ROCK Sonar ... "
  69. curl -k -F "v=${rockver}" -F "r=${revision}" -F "t=${target}" -F "d=${description}" -F "c=${comment}" -F "action=add" -F "f=@varadm.tar.bz2" http://scavenger.homeip.net/ROCK/sonar/search.pl
  70. echo "done"
  71. echo -n "Cleaning up ... "
  72. rm -f varadm.tar.bz2
  73. cd -
  74. echo "done"
  75. }
  76. config="default"
  77. while [ -n "${1}" ] ; do
  78. config="${1#config/}"
  79. if [ -d "config/${config}" ] ; then
  80. commit "${config}"
  81. else
  82. echo "Configuration \"${config}\" does not exist!" >&2
  83. fi
  84. shift
  85. done