nonsense check for installed kernel
When adding yaourt to basel-devel group I had a closer look at install_base()
again and noticed:
if [[ $(cat ${PACKAGES}) == "" ]]; then
# Check to see if a kernel is already installed
ls ${MOUNTPOINT}/boot/*.img >/dev/null 2>&1
if [[ $? == 0 ]]; then
check_for_error "linux-$(ls ${MOUNTPOINT}/boot/*.img | cut -d'-' -f2) is already installed"
KERNEL="y"
else
for i in $(cat /tmp/.available_kernels); do
[[ $(cat ${PACKAGES} | grep ${i}) != "" ]] && KERNEL="y" && break;
so cat a file in case it is empty? Can't be right!
Also the logic with $Kernel=y/n
doesn't seem to make sense:
Installing base ultimately starts with
if [[ $(cat ${PACKAGES}) != "" ]]; then
But in case we would have detected a pre-installed kernel and $KERNEL
would have been set to y
accordingly, $PACKAGES
could very well be empty if base-devel has not been selected, right?