Skip to content

Commit

Permalink
lxc-kali: Reduce diff with Debian
Browse files Browse the repository at this point in the history
Another commit, in the spirit of 0862ddf, 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 <[email protected]>
  • Loading branch information
elboulangero committed Feb 1, 2024
1 parent a0745c8 commit dd044cd
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions templates/lxc-kali.in
Original file line number Diff line number Diff line change
Expand Up @@ -230,17 +230,23 @@ write_sourceslist()
cat >> "${rootfs}/etc/apt/sources.list" << EOF
${prefix} $MIRROR ${release} main${non_main}
EOF
}

apt_update_packages(){
local apt_update_args="update"
chroot "${rootfs}" apt-get $apt_update_args
return $?
}

install_packages()
{
local rootfs="$1"; shift
local packages="$*"

chroot "${rootfs}" apt-get update
if [ -n "${packages}" ]; then
chroot "${rootfs}" apt-get install --force-yes -y --no-install-recommends ${packages}
if [ -n "${packages}" ] && apt_update_packages; then
chroot "${rootfs}" apt-get install -y --no-install-recommends ${packages}
elif [ -n "${packages}" ]; then
echo "Apt update failed, not downloading packages"
fi
}

Expand Down

0 comments on commit dd044cd

Please sign in to comment.