]> git.saurik.com Git - apt.git/blame - dselect/update
Fixed cd stuff and some minor bugs
[apt.git] / dselect / update
CommitLineData
7a1b1f8b
AL
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"
c217f42a 10PROMPT="no"
7a1b1f8b
AL
11RES=`apt-config shell OPTS DSelect::UpdateOptions \
12 DPKG Dir::Bin::dpkg APTGET Dir::Bin::apt-get \
c217f42a
AL
13 APTCACHE Dir::Bin::apt-cache CACHEDIR Dir::Cache \
14 PROMPT DSelect::PromptAfterUpdate`
7a1b1f8b
AL
15eval $RES
16
5b8c90bf
AL
17# It looks slightly ugly to have a double / in the dpkg output
18CACHEDIR=`echo $CACHEDIR | sed -e "s|/$||"`
19
7a1b1f8b
AL
20$APTGET $OPTS update
21
22echo "Merging Available information"
23rm -f /var/cache/apt/available
24$APTCACHE dumpavail > $CACHEDIR/available
25$DPKG --update-avail $CACHEDIR/available
26rm -f $CACHEDIR/available
c217f42a 27
8e7e7700 28if [ $PROMPT = "yes" ]; then
c217f42a
AL
29 echo "Press enter to continue." && read RES;
30fi
31
7a1b1f8b 32exit 0