Bug#295749: patch

Jason Thomas Jason Thomas <jason@debian.org>, 295749@bugs.debian.org
Fri, 18 Feb 2005 10:18:54 +1100


--x+6KMIRAuhnl3hBn
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

tags 295749 patch
thanks

-- 
Jason

"I hope you learn speaking English proper I hope speak I me you."
     -- Branden Robinson, 2001

--x+6KMIRAuhnl3hBn
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="update-grub_kopt_fix.diff"

--- grub-0.95+cvs20040624/debian/update-grub	2005-02-18 10:15:45.000000000 +1100
+++ ../update-grub	2005-02-18 10:10:10.000000000 +1100
@@ -399,7 +399,7 @@
 {
 	opt=$1
 
-	GetMenuOpts $opt | sed "s/^# $opt=\(.*\)\$/\1=\"\4\"/"
+	GetMenuOpts $opt | sed "s/^# $opt=\(.*\)\$/\1=\"\2\"/"
 }
 
 GetMenuOpt()
@@ -528,14 +528,15 @@
 {
 	kernel_version=$1
 
-	version=$(echo $kernel_version | sed 's/[^0-9]*\([0-9]\+\)\.\([0-9]\+\)\.\([0-9]\+\).*/\1_\2_\3/')
+	version=$(echo $kernel_version | sed 's/^[^0-9]*//')
+	version=$(echo $kernel_version | sed 's/[.-]/_/g')
 	if [ -n "$version" ] ; then
 		while [ -n "$version" ] ; do
 			currentOpt="$(eval "echo \$kopt_$version")"
 			if [ -n "$currentOpt" ] ; then
 				break
 			fi
-			version=$(echo $version | sed 's/_\?[0-9]*$//')
+			version=$(echo $version | sed 's/_\?[^_]*$//')
 		done
 	fi
 
@@ -616,8 +617,8 @@
 kopt=$(GetMenuOpt "kopt" "$kopt")
 
 # Extract options for specific kernels
-eval $(ExtractMenuOpts "\(kopt_[0-9]\(_[0-9]\{1,2\}\(_[0-9]\{1,2\}\)\?\)\?\)")
-CustomKopts=$(GetMenuOpts "\(kopt_[0-9]\(_[0-9]\{1,2\}\(_[0-9]\{1,2\}\)\?\)\?\)")
+eval $(ExtractMenuOpts "\(kopt_[a-zA-Z0-9_]\+\)")
+CustomKopts=$(GetMenuOpts "\(kopt_[a-zA-Z0-9_]\+\)")
 
 # Extract the grub root
 grub_root_device=$(GetMenuOpt "groot" "$grub_root_device")

--x+6KMIRAuhnl3hBn--