update 800 B

123456789101112131415161718192021222324252627282930313233
  1. #!/bin/sh
  2. set -e
  3. # Get the configuration from /etc/apt/apt.conf
  4. OPTS="-f"
  5. APTGET="/usr/bin/apt-get"
  6. APTCACHE="/usr/bin/apt-cache"
  7. DPKG="/usr/bin/dpkg"
  8. CACHEDIR="/var/cache/apt"
  9. PROMPT="no"
  10. RES=`apt-config shell OPTS DSelect::UpdateOptions \
  11. DPKG Dir::Bin::dpkg APTGET Dir::Bin::apt-get \
  12. APTCACHE Dir::Bin::apt-cache CACHEDIR Dir::Cache \
  13. PROMPT DSelect::PromptAfterUpdate`
  14. eval $RES
  15. # It looks slightly ugly to have a double / in the dpkg output
  16. CACHEDIR=`echo $CACHEDIR | sed -e "s|/$||"`
  17. $APTGET $OPTS update
  18. echo "Merging Available information"
  19. rm -f /var/cache/apt/available
  20. $APTCACHE dumpavail > $CACHEDIR/available
  21. $DPKG --update-avail $CACHEDIR/available
  22. rm -f $CACHEDIR/available
  23. if [ $PROMPT = "yes" ]; then
  24. echo "Press enter to continue." && read RES;
  25. fi
  26. exit 0