summaryrefslogtreecommitdiff
path: root/localpdebuild
blob: 3ff5a4c196bb053a8bf709ba402945b46ad5687d (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. -B)
  33. debbuildopts="$debbuildopts $1"
  34. pdebuildopts="$pdebuildopts --use-pdebuild-internal"
  35. shift
  36. ;;
  37. -*)
  38. debbuildopts="$debbuildopts $1"
  39. shift
  40. ;;
  41. *)
  42. echo "ERROR: Unknown argument \"$1\"!" &>2
  43. showhelp
  44. exit 1
  45. ;;
  46. esac
  47. done
  48. pbuilderopts="$pbuilderopts $@"
  49. pdebuild \
  50. --buildresult $HOME/pub/debian-$buildhost/pbuild-$pool/ \
  51. ${debbuildopts:+--debbuildopts $debbuildopts} \
  52. $pdebuildopts \
  53. -- \
  54. --basetgz /var/cache/pbuilder/base-$pool.tgz \
  55. --buildplace /var/cache/pbuilder/build-$pool/ \
  56. --aptcache /var/cache/pbuilder/aptcache-$pool/ \
  57. $pbuilderopts