summaryrefslogtreecommitdiff
path: root/localpdebuild
blob: 763ecd65d42fb8d2543bb349a97c3441b6f827e7 (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. --buildresult $HOME/src/pbuild-$pool/ \
  45. ${debbuildopts:+--debbuildopts $debbuildopts} \
  46. $pdebuildopts \
  47. -- \
  48. --basetgz /var/cache/pbuilder/base-$pool.tgz \
  49. --buildplace /var/cache/pbuilder/build-$pool/ \
  50. --aptcache /var/cache/pbuilder/aptcache-$pool/ \
  51. --pkgname-logfile \
  52. $pbuilderopts
  53. # $pbuilderopts \
  54. # | tee $HOME/src/pbuild-$pool/buildlog.$$
  55. done