File: 99-override-default-apt-conf

package info (click to toggle)
python-diskimage-builder 3.39.0-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 5,704 kB
  • sloc: sh: 7,474; python: 6,454; makefile: 37
file content (21 lines) | stat: -rwxr-xr-x 592 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/bash
# Override the default /etc/apt/apt.conf with $DIB_APT_CONF

if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then
    set -x
fi
set -eu
set -o pipefail

# exit directly if DIB_APT_CONF is not defined properly
if [ -z "${DIB_APT_CONF:-}" ] ; then
    echo "DIB_APT_CONF is not set - no apt.conf will be copied in"
    exit 0
elif [ ! -f "$DIB_APT_CONF" ] ; then
    echo "$DIB_APT_CONF is not a valid apt.conf file."
    echo "You should assign a proper apt.conf file in DIB_APT_CONF"
    exit 1
fi

# copy the apt.conf to cloudimg
sudo cp -L -f $DIB_APT_CONF $TMP_MOUNT_PATH/etc/apt/apt.conf