summaryrefslogtreecommitdiff
path: root/localpdebuild
blob: 733cbb489013fb17f516869dce7ca26d16df15ad (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. pdebuild \
  42. --buildresult $HOME/src/pbuild-$pool/ \
  43. ${debbuildopts:+--debbuildopts $debbuildopts} \
  44. $pdebuildopts \
  45. -- \
  46. --basetgz /var/cache/pbuilder/base-$pool.tgz \
  47. --buildplace /var/cache/pbuilder/build-$pool/ \
  48. --aptcache /var/cache/pbuilder/aptcache-$pool/ \
  49. --pkgname-logfile \
  50. $@
  51. done