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

2016-11-13 Thread Ronny Standtke
> 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-||')"
 


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

2016-09-17 Thread Daniel Reichelt
Hi Ronny,

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


Cheers
Daniel


On 09/17/2016 02:13 PM, Ronny Standtke wrote:
> Package: live-tools
> Version: 1:20151214+nmu1
> Severity: important
> Tags: patch
> 
> On my Debian Live system update-initramfs fails with the following error 
> message:
> 
> cp: cannot stat '/boot/vmlinuz-.old-dkms': No such file or 
> directory
> 
> Please find attached a patch that fixes this issue.
> 
> Cheers
> 
> Ronny
> 



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

2016-09-17 Thread Ronny Standtke
Package: live-tools
Version: 1:20151214+nmu1
Severity: important
Tags: patch

On my Debian Live system update-initramfs fails with the following error 
message:

cp: cannot stat '/boot/vmlinuz-.old-dkms': No such file or 
directory

Please find attached a patch that fixes this issue.

Cheers

Ronny

>From 1431278240b84651947cf56cc27c95177883c2bf Mon Sep 17 00:00:00 2001
From: Ronny Standtke 
Date: Sat, 17 Sep 2016 13:56:54 +0200
Subject: [PATCH] exclude initrd backup files

---
 bin/live-update-initramfs | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/bin/live-update-initramfs b/bin/live-update-initramfs
index 3cdbed3..9ae4b80 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-||')"
 
-- 
2.1.4