-sh -e
-RES=`apt-config shell CLEAN DSelect::Clean OPTS DSelect::Options \
- DPKG Dir::Bin::dpkg APTGET Dir::Bin::apt-get`
+DPKG_OPTS="--admindir=$1"
+APT_OPT0="-oDir::State::status=$1/status"
+APT_OPT1="-oDPkg::Options::=$DPKG_OPTS"
+set -e
+RES=$(apt-config shell CLEAN DSelect::Clean OPTS DSelect::Options \
+ DPKG Dir::Bin::dpkg/f APTGET Dir::Bin::apt-get/f \
+ ARCHIVES Dir::Cache::Archives/d \
+ WAIT DSelect::WaitAfterDownload/b \
+ CHECKDIR DSelect::CheckDir/b)