]> git.saurik.com Git - apt.git/blame_incremental - dselect/update
Gettext stuff
[apt.git] / dselect / update
... / ...
CommitLineData
1#!/bin/sh
2set -e
3
4# Get the configuration from /etc/apt/apt.conf
5CLEAN="prompt"
6OPTS="-f"
7APTGET="/usr/bin/apt-get"
8APTCACHE="/usr/bin/apt-cache"
9DPKG="/usr/bin/dpkg"
10DPKG_OPTS="--admindir=$1"
11APT_OPT0="-oDir::State::status=$1/status"
12APT_OPT1="-oDPkg::Options::=$DPKG_OPTS"
13CACHEDIR="/var/cache/apt"
14PROMPT="false"
15RES=`apt-config shell CLEAN DSelect::Clean OPTS DSelect::UpdateOptions \
16 DPKG Dir::Bin::dpkg/f APTGET Dir::Bin::apt-get/f \
17 APTCACHE Dir::Bin::apt-cache/f CACHEDIR Dir::Cache/d \
18 PROMPT DSelect::PromptAfterUpdate/b`
19eval $RES
20
21# It looks slightly ugly to have a double / in the dpkg output
22CACHEDIR=`echo $CACHEDIR | sed -e "s|/$||"`
23
24STATUS=1
25if $APTGET $OPTS "$APT_OPT0" "$APT_OPT1" update
26then
27 echo "Merging Available information"
28 rm -f $CACHEDIR/available
29 $APTCACHE dumpavail > $CACHEDIR/available
30 $DPKG "$DPKG_OPTS" --update-avail $CACHEDIR/available
31 rm -f $CACHEDIR/available
32
33 case "$CLEAN" in
34 Pre-Auto|PreAuto|pre-auto)
35 $APTGET "$APT_OPT0" "$APT_OPT1" autoclean;;
36 esac
37
38 STATUS=0
39fi
40
41if [ x$PROMPT = "xtrue" ]; then
42 echo "Press enter to continue." && read RES;
43fi
44
45exit $STATUS