docker-devuan_paddy-hack/scripts/tweak-apt-config

25 lines
533 B
Bash
Executable File

#!/bin/sh -eu
# tweak-apt-config -- for use in a Docker image
# Copyright (C) 2017 Olaf Meeuwissen
#
# License: GPL-3.0+
DIR=/
ETC=etc/apt
PARTS=apt.conf.d
eval $(apt-config shell DIR Dir)
eval $(apt-config shell ETC Dir::Etc)
eval $(apt-config shell PARTS Dir::Etc::Parts)
cfg=$DIR$ETC$PARTS
cmd=$(dirname $0)/docker-apt-clean
cat > $cfg/docker-clean <<- EOF
DPkg::Post-Invoke { "if test -x $cmd; then $cmd; fi"; };
APT::Update::Post-Invoke { "if test -x $cmd; then $cmd; fi"; };
EOF
chmod 0644 $cfg/docker-clean
rm $0