summaryrefslogtreecommitdiff
path: root/localcowdebuild
blob: 70095f646f052fa3390febc87ccef4099f174872 (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. pbuilderopts=''
  14. pdebuildopts=''
  15. debbuildopts=''
  16. while [ $# -gt 0 ]; do
  17. case $1 in
  18. -h|--help)
  19. showhelp
  20. exit 0
  21. ;;
  22. --)
  23. shift
  24. break
  25. ;;
  26. --*)
  27. echo "ERROR: Unknown argument \"$1\"!" &>2
  28. showhelp
  29. exit 1
  30. ;;
  31. -*)
  32. debbuildopts="$debbuildopts $1"
  33. shift
  34. ;;
  35. *)
  36. pools="$pools $1"
  37. shift
  38. ;;
  39. esac
  40. done
  41. pbuilderopts="$pbuilderopts $@"
  42. for pool in $pools; do
  43. pdebuild \
  44. --pbuilder cowbuilder \
  45. --buildresult $HOME/src/pbuild-$pool/ \
  46. ${debbuildopts:+--debbuildopts $debbuildopts} \
  47. $pdebuildopts \
  48. -- \
  49. --basepath /var/cache/pbuilder/cow-$pool \
  50. --buildplace /var/cache/pbuilder/build-$pool/cow-$$ \
  51. --aptcache /var/cache/pbuilder/aptcache-$pool/ \
  52. --pkgname-logfile \
  53. $pbuilderopts
  54. # $pbuilderopts \
  55. # | tee $HOME/src/pbuild-$pool/buildlog.$$
  56. done