Verified Commit 145258bc authored by Paul Wise's avatar Paul Wise

Switch from apt -o to APT_CONFIG

apt command-line options are applied after all other apt config, so they cannot easily be used to isolate apt from the system config. APT_CONFIG is read before any other apt configuration so it can.
parent f2b47108
......@@ -75,28 +75,33 @@ fi
# All these options make apt read the right sources list, and use APTDIR for
# everything so it need not run as root.
APT_GET="apt-get --assume-yes \
-o Dir::Etc::sourcelist=`pwd`/$LIST \
-o Dir::Etc::sourceparts=/dev/null \
-o Dir::Etc::Preferences=`pwd`/preferences.$TYPE.local \
-o Dir::State=`pwd`/$APTDIR/state \
-o Debug::NoLocking=true \
-o Debug::pkgDepCache::AutoInstall=true \
-o Dir::Cache=`pwd`/$APTDIR/cache \
-o Acquire::Retries=3 \
-o APT::Install-Recommends=false
-o Apt::Architecture=`dpkg-architecture -qDEB_HOST_ARCH` \
-o Dir::Etc::trusted="$KEYRING"
"
export APT_CONFIG="$APTDIR/apt.conf"
PWD="$(pwd)"
cat > "$APT_CONFIG" <<EOF
Dir "$PWD/$APTDIR";
Dir::Etc::sourcelist "$PWD/$LIST";
Dir::Etc::sourceparts "/dev/null";
Dir::Etc::Preferences "$PWD/preferences.$TYPE.local";
Dir::State "$PWD/$APTDIR/state";
Debug::NoLocking "true";
Debug::pkgDepCache::AutoInstall "true";
Dir::Cache "$PWD/$APTDIR/cache";
Acquire::Retries "3";
APT::Install-Recommends "false";
Apt::Architecture "$DEB_HOST_ARCH";
Dir::Etc::trusted "$KEYRING";
Dir::State::Status "$PWD/$APTDIR/state/status";
EOF
APT_GET="apt-get --assume-yes"
# Prepare APTDIR
mkdir -p $APTDIR/state/lists/partial
mkdir -p $APTDIR/state/mirrors/partial
mkdir -p $APTDIR/cache/archives/partial
echo -n > $APTDIR/state/status
if [ "$TYPE" = "deb" ]; then
APT_GET="$APT_GET -o Dir::State::Status=`pwd`/$APTDIR/state/status"
else
if [ "$TYPE" != "deb" ]; then
# Prime status file with a few system libraries that don't
# currently have udebs, or which udebs still depend on for various
# reasons.
......@@ -115,7 +120,6 @@ else
echo >> $APTDIR/state/status
fi
done
APT_GET="$APT_GET -o Dir::State::Status=`pwd`/$APTDIR/state/status"
fi
# Update package lists and autoclean cache.
......
......@@ -24,6 +24,9 @@ debian-installer (2018XXXX) UNRELEASED; urgency=medium
* hppa: Use compressed kernel image by default.
* sparc64: Use xz compression for initrd during netboot image build.
[ Paul Wise ]
* Switch get-packages from using apt -o to APT_CONFIG
-- Cyril Brulebois <kibi@debian.org> Tue, 26 Dec 2017 15:10:47 +0100
debian-installer (20171204) unstable; urgency=medium
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment