summaryrefslogtreecommitdiff
path: root/localcowdebuild
blob: c1ba1817612f4eca6f1fd169d980ed273283078c (plain)
  1. #!/bin/sh
  2. set -e
  3. PRG=$(basename "$0")
  4. function showhelp() {
  5. cat <<EOF
  6. Usage: $PRG POOL [debbuildopts] [-- pbuilderopts]"
  7. Example: $PRG sarge_with_hacks -B"
  8. EOF
  9. }
  10. if [ $# -eq 0 ]; then
  11. showhelp
  12. exit 1
  13. fi
  14. pools=''
  15. pdebuildopts=''
  16. debbuildopts=''
  17. while [ $# -gt 0 ]; do
  18. case $1 in
  19. -h|--help)
  20. showhelp
  21. exit 0
  22. ;;
  23. --)
  24. shift
  25. break
  26. ;;
  27. --*)
  28. echo "ERROR: Unknown argument \"$1\"!" &>2
  29. showhelp
  30. exit 1
  31. ;;
  32. -*)
  33. debbuildopts="$debbuildopts $1"
  34. shift
  35. ;;
  36. *)
  37. pools="$pools $1"
  38. shift
  39. ;;
  40. esac
  41. done
  42. for pool in $pools; do
  43. basepath="/var/cache/pbuilder/cow-$pool"
  44. buildplace="/var/cache/pbuilder/build-$pool"
  45. aptcache="/var/cache/pbuilder/aptcache-$pool/"
  46. hookdir="/var/cache/pbuilder/hooks-$pool/"
  47. buildresult="$HOME/src/pbuild-$pool/"
  48. pdebuild \
  49. --pbuilder cowbuilder \
  50. --buildresult "$buildresult" \
  51. ${debbuildopts:+--debbuildopts "$debbuildopts"} \
  52. $pdebuildopts \
  53. -- \
  54. --basepath "$basepath" \
  55. --buildplace "$buildplace" \
  56. --aptcache "$aptcache" \
  57. --hookdir "$hookdir" \
  58. --pkgname-logfile \
  59. $@
  60. done