summaryrefslogtreecommitdiff
path: root/localpdebuild
blob: f62bf0fecf8fe41da8edd9706b5282da77f26cf9 (plain)
  1. #!/bin/sh
  2. set -e
  3. PRG=$(basename "$0")
  4. function showhelp() {
  5. cat <<EOF
  6. Usage: $PRG POOL [debbuildopts] [-- pbuilderopts]
  7. Example: $PRG sarge_with_hacks -B
  8. EOF
  9. }
  10. if [ $# -eq 0 ]; then
  11. showhelp
  12. exit 1
  13. fi
  14. pools=''
  15. pdebuildopts=''
  16. debbuildopts=''
  17. while [ $# -gt 0 ]; do
  18. case $1 in
  19. -h|--help)
  20. showhelp
  21. exit 0
  22. ;;
  23. --)
  24. shift
  25. break
  26. ;;
  27. --*)
  28. echo "ERROR: Unknown argument \"$1\"!" &>2
  29. showhelp
  30. exit 1
  31. ;;
  32. -*)
  33. debbuildopts="$debbuildopts $1"
  34. shift
  35. ;;
  36. *)
  37. pools="$pools $1"
  38. shift
  39. ;;
  40. esac
  41. done
  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. $@
  53. done