summaryrefslogtreecommitdiff
path: root/localcowdebuild
blob: 702fc1f8e2eb417d2bd3cab5e0609a55d7f0aba1 (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. hookdir="/var/cache/pbuilder/hooks/"
  45. buildresult="$HOME/src/pbuild-$pool/"
  46. pdebuild \
  47. --pbuilder cowbuilder \
  48. --buildresult "$buildresult" \
  49. ${debbuildopts:+--debbuildopts $debbuildopts} \
  50. $pdebuildopts \
  51. -- \
  52. --basepath "$basepath" \
  53. --buildplace "$buildplace" \
  54. --aptcache "$aptcache" \
  55. --hookdir "$hookdir" \
  56. --pkgname-logfile \
  57. $@
  58. done