summaryrefslogtreecommitdiff
path: root/localcowbuilder-update
blob: cf397f24ec322fee3c8f9fdca315a61266473b1b (plain)
  1. #!/bin/sh
  2. set -e
  3. PRG=$(basename "$0")
  4. function showhelp() {
  5. cat <<EOF
  6. Usage: $PRG POOL
  7. Example: $PRG 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