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