]>
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" | |
b2e465d6 AL |
9 | DPKG_OPTS="--admindir=$1" |
10 | APT_OPT0="-oDir::State::status=$1/status" | |
11 | APT_OPT1="-oDPkg::Options::=$DPKG_OPTS" | |
7a1b1f8b | 12 | CACHEDIR="/var/cache/apt" |
b2e465d6 | 13 | PROMPT="false" |
7a1b1f8b | 14 | RES=`apt-config shell OPTS DSelect::UpdateOptions \ |
b2e465d6 AL |
15 | DPKG Dir::Bin::dpkg/f APTGET Dir::Bin::apt-get/f \ |
16 | APTCACHE Dir::Bin::apt-cache/f CACHEDIR Dir::Cache/d \ | |
17 | PROMPT DSelect::PromptAfterUpdate/b` | |
7a1b1f8b AL |
18 | eval $RES |
19 | ||
5b8c90bf AL |
20 | # It looks slightly ugly to have a double / in the dpkg output |
21 | CACHEDIR=`echo $CACHEDIR | sed -e "s|/$||"` | |
22 | ||
08cfc005 AL |
23 | set +e |
24 | FAILED=0 | |
b2e465d6 | 25 | $APTGET $OPTS "$APT_OPT0" "$APT_OPT1" update || FAILED=1 |
08cfc005 | 26 | set -e |
7a1b1f8b AL |
27 | |
28 | echo "Merging Available information" | |
7fd9eec4 | 29 | rm -f $CACHEDIR/available |
7a1b1f8b | 30 | $APTCACHE dumpavail > $CACHEDIR/available |
b2e465d6 | 31 | $DPKG "$DPKG_OPTS" --update-avail $CACHEDIR/available |
7a1b1f8b | 32 | rm -f $CACHEDIR/available |
c217f42a | 33 | |
b2e465d6 | 34 | if [ x$PROMPT = "xtrue" ]; then |
c217f42a AL |
35 | echo "Press enter to continue." && read RES; |
36 | fi | |
37 | ||
08cfc005 | 38 | exit $FAILED |