Blame SOURCES/0016-Windows-detection-requires-binary-grep-1322956.patch

e8c52d
From d386798730760551d4eee843bfbebd8f7a0aa64a Mon Sep 17 00:00:00 2001
e8c52d
From: Cyril Brulebois <kibi@debian.org>
e8c52d
Date: Fri, 10 Jul 2015 00:59:38 +0200
e8c52d
Subject: [PATCH 16/18] Windows detection requires binary grep (#1322956)
e8c52d
e8c52d
------------------------------------------------------------------------
e8c52d
Add -a flag to grep -qs for Windows Vista detection (Closes: #791383).
e8c52d
e8c52d
It appears the file isn't always considered as a text file, so this should be
e8c52d
more robust. Thanks to Gianluigi Tiesi for the report and the suggestion.
e8c52d
------------------------------------------------------------------------
e8c52d
(cherry picked from commit 15dec5c28b77b6db1492e42e25946cd7ae7a7885)
e8c52d
e8c52d
Resolves: rhbz#1322956
e8c52d
---
e8c52d
 os-probes/mounted/x86/20microsoft | 14 +++++++-------
e8c52d
 1 file changed, 7 insertions(+), 7 deletions(-)
e8c52d
e8c52d
diff --git a/os-probes/mounted/x86/20microsoft b/os-probes/mounted/x86/20microsoft
e8c52d
index bf829d9..ca255d8 100755
e8c52d
--- a/os-probes/mounted/x86/20microsoft
e8c52d
+++ b/os-probes/mounted/x86/20microsoft
e8c52d
@@ -31,19 +31,19 @@ if item_in_dir -q bootmgr "$2"; then
e8c52d
 	for boot in $(item_in_dir boot "$2"); do
e8c52d
 		bcd=$(item_in_dir bcd "$2/$boot")
e8c52d
 		if [ -n "$bcd" ]; then
e8c52d
-			if grep -qs "W.i.n.d.o.w.s. .8" "$2/$boot/$bcd"; then
e8c52d
+			if grep -aqs "W.i.n.d.o.w.s. .8" "$2/$boot/$bcd"; then
e8c52d
 				long="Windows 8 (loader)"
e8c52d
-			elif grep -qs "W.i.n.d.o.w.s. .7" "$2/$boot/$bcd"; then
e8c52d
+			elif grep -aqs "W.i.n.d.o.w.s. .7" "$2/$boot/$bcd"; then
e8c52d
 				long="Windows 7 (loader)"
e8c52d
-			elif grep -qs "W.i.n.d.o.w.s. .V.i.s.t.a" "$2/$boot/$bcd"; then
e8c52d
+			elif grep -aqs "W.i.n.d.o.w.s. .V.i.s.t.a" "$2/$boot/$bcd"; then
e8c52d
 				long="Windows Vista (loader)"
e8c52d
-			elif grep -qs "W.i.n.d.o.w.s. .S.e.r.v.e.r. .2.0.0.8. .R.2." "$2/$boot/$bcd"; then
e8c52d
+			elif grep -aqs "W.i.n.d.o.w.s. .S.e.r.v.e.r. .2.0.0.8. .R.2." "$2/$boot/$bcd"; then
e8c52d
 				long="Windows Server 2008 R2 (loader)"
e8c52d
-			elif grep -qs "W.i.n.d.o.w.s. .S.e.r.v.e.r. .2.0.0.8." "$2/$boot/$bcd"; then
e8c52d
+			elif grep -aqs "W.i.n.d.o.w.s. .S.e.r.v.e.r. .2.0.0.8." "$2/$boot/$bcd"; then
e8c52d
 				long="Windows Server 2008 (loader)"
e8c52d
-			elif grep -qs "W.i.n.d.o.w.s. .R.e.c.o.v.e.r.y. .E.n.v.i.r.o.n.m.e.n.t" "$2/$boot/$bcd"; then
e8c52d
+			elif grep -aqs "W.i.n.d.o.w.s. .R.e.c.o.v.e.r.y. .E.n.v.i.r.o.n.m.e.n.t" "$2/$boot/$bcd"; then
e8c52d
 				long="Windows Recovery Environment (loader)"
e8c52d
-			elif grep -qs "W.i.n.d.o.w.s. .S.e.t.u.p" "$2/$boot/$bcd"; then
e8c52d
+			elif grep -aqs "W.i.n.d.o.w.s. .S.e.t.u.p" "$2/$boot/$bcd"; then
e8c52d
 				long="Windows Recovery Environment (loader)"
e8c52d
 			else
e8c52d
 				long="Windows Vista (loader)"
e8c52d
-- 
e8c52d
2.5.5
e8c52d