summaryrefslogtreecommitdiff
path: root/localpdebuild
blob: 869ddf2a5ad039347ea831f4c9fd5d241e89c14a (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. pool=$1; shift
  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. echo "ERROR: Unknown argument \"$1\"!" &>2
  37. showhelp
  38. exit 1
  39. ;;
  40. esac
  41. done
  42. pbuilderopts="$pbuilderopts $@"
  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. $pbuilderopts