summaryrefslogtreecommitdiff
path: root/localcowdebuild
blob: 340f6841579a3e4a6527db86b2c7acadaad3f9e1 (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. basepath="/var/cache/pbuilder/cow-$pool"
  44. buildplace="/var/cache/pbuilder/build-$pool/cow-$$"
  45. aptcache="/var/cache/pbuilder/aptcache-$pool/"
  46. buildresult="$HOME/src/pbuild-$pool/"
  47. pdebuild \
  48. --pbuilder cowbuilder \
  49. --buildresult "$buildresult" \
  50. ${debbuildopts:+--debbuildopts $debbuildopts} \
  51. $pdebuildopts \
  52. -- \
  53. --basepath "$basepath" \
  54. --buildplace "$buildplace" \
  55. --aptcache "$aptcache" \
  56. --pkgname-logfile \
  57. $pbuilderopts
  58. # $pbuilderopts \
  59. # | tee $HOME/src/pbuild-$pool/buildlog.$$
  60. done