summaryrefslogtreecommitdiff
path: root/localpdebuild
blob: c3d85b88c7dc56c72935cbafe7ccb7e691f26703 (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. export CCACHE_DIR="/var/cache/pbuilder/ccache-$pool"
  44. export PATH="/usr/lib/ccache:${PATH}"
  45. pdebuild \
  46. --buildresult $HOME/src/pbuild-$pool/ \
  47. ${debbuildopts:+--debbuildopts $debbuildopts} \
  48. $pdebuildopts \
  49. -- \
  50. --basetgz /var/cache/pbuilder/base-$pool.tgz \
  51. --buildplace /var/cache/pbuilder/build-$pool/ \
  52. --aptcache /var/cache/pbuilder/aptcache-$pool/ \
  53. $pbuilderopts