summaryrefslogtreecommitdiff
path: root/localcowbuilder-update
blob: b3cedcb27218fd8132d277fc7be84f7f1a1d599f (plain)
  1. #!/bin/sh
  2. set -e
  3. PRG=$(basename "$0")
  4. function showhelp() {
  5. cat <<EOF
  6. Usage: $(basename $0) POOL
  7. Example: $(basename $0) sarge_with_hacks
  8. EOF
  9. }
  10. if [ $# -eq 0 ]; then
  11. showhelp
  12. exit 1
  13. fi
  14. export DEBIAN_FRONTEND="noninteractive"
  15. export LANG=C
  16. for pool in $@; do
  17. basepath="/var/cache/pbuilder/cow-$pool"
  18. aptcache="/var/cache/pbuilder/aptcache-$pool/"
  19. # sudo cowbuilder --update \
  20. # --basepath "$basepath" \
  21. # --aptcache "$aptcache"
  22. sudo find "$aptcache" -type f -exec cp -a '{}' "$basepath/var/cache/apt/archives/" ';'
  23. sudo chroot "$basepath" apt-get -y --force-yes update
  24. sudo chroot "$basepath" apt-get -y --force-yes upgrade
  25. sudo chroot "$basepath" apt-get -y --force-yes clean
  26. done