From ba54423bf8131ee1d61e619f8f4e784d5457c1f8 Mon Sep 17 00:00:00 2001 From: josch Date: Fri, 24 Apr 2015 00:50:24 +0200 Subject: find_dpkg_trigger_cycles.sh: use APT_CONFIG environment variable instead of commandline option - using commandline options does not work reliably because commandline options are parsed last and thus many settings will not take effect - see apt.conf(5) for the order in which configuration file parameters are parsed by apt --- bin/find_dpkg_trigger_cycles.sh | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/bin/find_dpkg_trigger_cycles.sh b/bin/find_dpkg_trigger_cycles.sh index 4fd1c16e..dc2b6ac9 100755 --- a/bin/find_dpkg_trigger_cycles.sh +++ b/bin/find_dpkg_trigger_cycles.sh @@ -109,20 +109,12 @@ DIST="$1" DIRECTORY="`pwd`/debian-$DIST-$ARCH" APT_OPTS="-y" -APT_OPTS=$APT_OPTS" -o Apt::Architecture=$ARCH" -APT_OPTS=$APT_OPTS" -o Dir::Etc::TrustedParts=$DIRECTORY/etc/apt/trusted.gpg.d" -APT_OPTS=$APT_OPTS" -o Dir::Etc::Trusted=$DIRECTORY/etc/apt/trusted.gpg" -APT_OPTS=$APT_OPTS" -o Dir=$DIRECTORY/" -APT_OPTS=$APT_OPTS" -o Dir::Etc=$DIRECTORY/etc/apt/" -APT_OPTS=$APT_OPTS" -o Dir::Etc::SourceList=$DIRECTORY/etc/apt/sources.list" -APT_OPTS=$APT_OPTS" -o Dir::State=$DIRECTORY/var/lib/apt/" -APT_OPTS=$APT_OPTS" -o Dir::State::Status=$DIRECTORY/var/lib/dpkg/status" -APT_OPTS=$APT_OPTS" -o Dir::Cache=$DIRECTORY/var/cache/apt/" #APT_OPTS=$APT_OPTS" -o Acquire::Check-Valid-Until=false" # because we use snapshot mkdir -p $DIRECTORY mkdir -p $DIRECTORY/etc/apt/ mkdir -p $DIRECTORY/etc/apt/trusted.gpg.d/ +mkdir -p $DIRECTORY/etc/apt/apt.conf.d/ mkdir -p $DIRECTORY/etc/apt/sources.list.d/ mkdir -p $DIRECTORY/etc/apt/preferences.d/ mkdir -p $DIRECTORY/var/lib/apt/ @@ -137,6 +129,21 @@ touch $DIRECTORY/var/lib/dpkg/status echo deb $MIRROR $DIST main > $DIRECTORY/etc/apt/sources.list +cat << END > "$DIRECTORY/etc/apt/apt.conf" +Apt::Architecture "$ARCH"; +Dir::Etc::TrustedParts "$DIRECTORY/etc/apt/trusted.gpg.d"; +Dir::Etc::Trusted "$DIRECTORY/etc/apt/trusted.gpg"; +Dir "$DIRECTORY/"; +Dir::Etc "$DIRECTORY/etc/apt/"; +Dir::Etc::SourceList "$DIRECTORY/etc/apt/sources.list"; +Dir::State "$DIRECTORY/var/lib/apt/"; +Dir::State::Status "$DIRECTORY/var/lib/dpkg/status"; +Dir::Cache "$DIRECTORY/var/cache/apt/"; +END + +APT_CONFIG="$DIRECTORY/etc/apt/apt.conf" +export APT_CONFIG + apt-get $APT_OPTS update APT_FILE_OPTS="--architecture $ARCH" -- cgit v1.2.3-70-g09d2