summaryrefslogtreecommitdiff
path: root/localpdebuild
blob: 03faec0c4b2ced8f8383aac75f55828b9c09f821 (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. buildhost=`hostname -s`
  13. pool=$1; shift
  14. pbuilderopts=''
  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. echo "ERROR: Unknown argument \"$1\"!" &>2
  38. showhelp
  39. exit 1
  40. ;;
  41. esac
  42. done
  43. pbuilderopts="$pbuilderopts $@"
  44. pdebuild \
  45. --buildresult $HOME/pub/debian-$buildhost/pbuild-$pool/ \
  46. ${debbuildopts:+--debbuildopts $debbuildopts} \
  47. $pdebuildopts \
  48. -- \
  49. --basetgz /var/cache/pbuilder/base-$pool.tgz \
  50. --buildplace /var/cache/pbuilder/build-$pool/ \
  51. --aptcache /var/cache/pbuilder/aptcache-$pool/ \
  52. $pbuilderopts