[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#838110: live-tools: exclude initrd backup files



> just a minor thing but I think you should anchor your grep to the end of
> the filename:
> grep -v "old-dkms$"

OK, please find attached an updated patch. I didn't use the quotes
around the expression because with quotes I got a build error about
bashisms.

Cheers
Ronny
diff --git a/bin/live-update-initramfs b/bin/live-update-initramfs
index 3cdbed3..eeb4840 100755
--- a/bin/live-update-initramfs
+++ b/bin/live-update-initramfs
@@ -55,12 +55,11 @@ case "${_READ_WRITE}" in
 		# Updating initramfs
 		/usr/sbin/update-initramfs.orig.initramfs-tools "${@}"
 
-		# FIXME: needs to exclude initrd backup files
-		if [ "$(ls /boot/initrd.img-* | wc -l)" -gt 1 ]
+		if [ "$(ls /boot/initrd.img-* | grep -v old-dkms$ | wc -l)" -gt 1 ]
 		then
 			_NUMBER="1"
 
-			for _INITRD in /boot/initrd.img-*
+			for _INITRD in $(ls /boot/initrd.img-* | grep -v old-dkms$)
 			do
 				_VERSION="$(basename ${_INITRD} | sed -e 's|initrd.img-||')"
 

Reply to: