1
0
mirror of https://github.com/lxc/lxc-templates.git synced 2024-12-22 06:20:13 +00:00

lxc-kali: Reduce diff with Debian

Another commit, in the spirit of 0862ddf3, that doesn't really change
anything in terms of functionality, but brings the code in lxc-kali.in
closer to the code in lxc-debian.in, making it easier to compare the two
files.

Signed-off-by: Arnaud Rebillout <arnaudr@kali.org>
This commit is contained in:
Arnaud Rebillout 2024-02-01 15:03:46 +07:00
parent a0745c836a
commit dd044cd9df

View File

@ -230,7 +230,12 @@ write_sourceslist()
cat >> "${rootfs}/etc/apt/sources.list" << EOF cat >> "${rootfs}/etc/apt/sources.list" << EOF
${prefix} $MIRROR ${release} main${non_main} ${prefix} $MIRROR ${release} main${non_main}
EOF EOF
}
apt_update_packages(){
local apt_update_args="update"
chroot "${rootfs}" apt-get $apt_update_args
return $?
} }
install_packages() install_packages()
@ -238,9 +243,10 @@ install_packages()
local rootfs="$1"; shift local rootfs="$1"; shift
local packages="$*" local packages="$*"
chroot "${rootfs}" apt-get update if [ -n "${packages}" ] && apt_update_packages; then
if [ -n "${packages}" ]; then chroot "${rootfs}" apt-get install -y --no-install-recommends ${packages}
chroot "${rootfs}" apt-get install --force-yes -y --no-install-recommends ${packages} elif [ -n "${packages}" ]; then
echo "Apt update failed, not downloading packages"
fi fi
} }