From d0010ebf6e814b6ef91ddb67a2748860108797fc Mon Sep 17 00:00:00 2001 From: Deepti Kulkarni Date: Mon, 16 Apr 2012 05:00:06 -0700 Subject: bug 7985: fix regex for rename system image command --- scripts/rename-image.pl | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'scripts') diff --git a/scripts/rename-image.pl b/scripts/rename-image.pl index 6f3084c..2c77d70 100644 --- a/scripts/rename-image.pl +++ b/scripts/rename-image.pl @@ -39,7 +39,7 @@ GetOptions( ); if (!defined($old_name) || !defined($new_name)) { - printf("Must specify both old ane new name.\n"); + printf("Must specify both old and new name.\n"); exit 1; } @@ -109,10 +109,11 @@ open (my $grubfh, '<', "${image_path}/grub/grub.cfg") # my $line; while ($line = <$grubfh>) { - $line =~ s/\/boot\/$old_name/\/boot\/$new_name/g; - $line =~ s/Vyatta $old_name/Vyatta $new_name/; - $line =~ s/Vyatta image $old_name/Vyatta image $new_name/; - $line =~ s/Lost password change $old_name/Lost password change $new_name/; + $line =~ s/\/boot\/$old_name\//\/boot\/$new_name\//g; + $line =~ s/\/boot\/$old_name /\/boot\/$new_name /g; + $line =~ s/Vyatta $old_name /Vyatta $new_name /; + $line =~ s/Vyatta image $old_name /Vyatta image $new_name /; + $line =~ s/Lost password change $old_name /Lost password change $new_name /; printf($tmpfh $line); } -- cgit v1.2.3