X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/b2e465d6d32d2dc884f58b94acb7e35f671a87fe..8d1cb6da6e21302c654da3f09de3975af7e4a11f:/dselect/update diff --git a/dselect/update b/dselect/update index a61086d79..0ab317ee4 100755 --- a/dselect/update +++ b/dselect/update @@ -1,8 +1,12 @@ -#!/bin/sh +#!/bin/bash set -e +# Set the textdomain for the translations using $"..." +TEXTDOMAIN="apt" + # Get the configuration from /etc/apt/apt.conf -OPTS="-f" +CLEAN="prompt" +OPTS="" APTGET="/usr/bin/apt-get" APTCACHE="/usr/bin/apt-cache" DPKG="/usr/bin/dpkg" @@ -11,28 +15,34 @@ APT_OPT0="-oDir::State::status=$1/status" APT_OPT1="-oDPkg::Options::=$DPKG_OPTS" CACHEDIR="/var/cache/apt" PROMPT="false" -RES=`apt-config shell OPTS DSelect::UpdateOptions \ - DPKG Dir::Bin::dpkg/f APTGET Dir::Bin::apt-get/f \ - APTCACHE Dir::Bin::apt-cache/f CACHEDIR Dir::Cache/d \ - PROMPT DSelect::PromptAfterUpdate/b` +RES=`apt-config shell CLEAN DSelect::Clean OPTS DSelect::UpdateOptions \ + DPKG Dir::Bin::dpkg/f APTGET Dir::Bin::apt-get/f \ + APTCACHE Dir::Bin::apt-cache/f CACHEDIR Dir::Cache/d \ + PROMPT DSelect::PromptAfterUpdate/b` eval $RES # It looks slightly ugly to have a double / in the dpkg output CACHEDIR=`echo $CACHEDIR | sed -e "s|/$||"` -set +e -FAILED=0 -$APTGET $OPTS "$APT_OPT0" "$APT_OPT1" update || FAILED=1 -set -e +STATUS=1 +if $APTGET $OPTS "$APT_OPT0" "$APT_OPT1" update +then + echo $"Merging available information" + rm -f $CACHEDIR/available + $APTCACHE dumpavail > $CACHEDIR/available + $DPKG "$DPKG_OPTS" --update-avail $CACHEDIR/available + rm -f $CACHEDIR/available -echo "Merging Available information" -rm -f $CACHEDIR/available -$APTCACHE dumpavail > $CACHEDIR/available -$DPKG "$DPKG_OPTS" --update-avail $CACHEDIR/available -rm -f $CACHEDIR/available + case "$CLEAN" in + Pre-Auto|PreAuto|pre-auto) + $APTGET "$APT_OPT0" "$APT_OPT1" autoclean;; + esac + + STATUS=0 +fi if [ x$PROMPT = "xtrue" ]; then - echo "Press enter to continue." && read RES; + echo $"Press [Enter] to continue." && read RES; fi -exit $FAILED +exit $STATUS