From 018cb283f238a605d1fac7d03caefe4e92eac8fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Mon, 11 May 2009 11:54:18 +0000 Subject: [PATCH] Fix `grub-menu-builder.sh'. Previously, since `nullglob' is active, `$(ls /boot/kernels/*)' would translate into `$(ls)' when `/boot/kernels' is empty, which would then lead to the removal of all the files under $PWD. Additionally, if `/boot/kernels' was not empty, `$fn' would contain only the basename of the files, whereas `$filesCopied' is indexed by full paths. svn path=/nixos/trunk/; revision=15548 --- installer/grub-menu-builder.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/installer/grub-menu-builder.sh b/installer/grub-menu-builder.sh index 464fc94ce22..8a99ca5f29d 100644 --- a/installer/grub-menu-builder.sh +++ b/installer/grub-menu-builder.sh @@ -15,7 +15,7 @@ bootMount="@bootMount@" if test -z "$bootMount"; then bootMount=/boot; fi -echo "updating the Grub menu..." +echo "updating the GRUB menu..." target=/boot/grub/menu.lst @@ -176,7 +176,7 @@ mv $tmp $target # Remove obsolete files from /boot/kernels. -for fn in $(ls /boot/kernels/*); do +for fn in /boot/kernels/*; do if ! test "${filesCopied[$fn]}" = 1; then rm -vf -- "$fn" fi