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