]>
Commit | Line | Data |
---|---|---|
7a1b1f8b AL |
1 | #!/bin/sh |
2 | set -e | |
3 | ||
4 | # Get the configuration from /etc/apt/apt.conf | |
5 | OPTS="-f" | |
6 | APTGET="/usr/bin/apt-get" | |
7 | APTCACHE="/usr/bin/apt-cache" | |
8 | DPKG="/usr/bin/dpkg" | |
9 | CACHEDIR="/var/cache/apt" | |
c217f42a | 10 | PROMPT="no" |
7a1b1f8b AL |
11 | RES=`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 |
15 | eval $RES |
16 | ||
5b8c90bf AL |
17 | # It looks slightly ugly to have a double / in the dpkg output |
18 | CACHEDIR=`echo $CACHEDIR | sed -e "s|/$||"` | |
19 | ||
08cfc005 AL |
20 | set +e |
21 | FAILED=0 | |
22 | $APTGET $OPTS update || FAILED=1 | |
23 | set -e | |
7a1b1f8b AL |
24 | |
25 | echo "Merging Available information" | |
7fd9eec4 | 26 | rm -f $CACHEDIR/available |
7a1b1f8b AL |
27 | $APTCACHE dumpavail > $CACHEDIR/available |
28 | $DPKG --update-avail $CACHEDIR/available | |
29 | rm -f $CACHEDIR/available | |
c217f42a | 30 | |
8e7e7700 | 31 | if [ $PROMPT = "yes" ]; then |
c217f42a AL |
32 | echo "Press enter to continue." && read RES; |
33 | fi | |
34 | ||
08cfc005 | 35 | exit $FAILED |