]> xenbits.xensource.com Git - libvirt.git/commitdiff
all: Don't use 'grep -q'
authorAndrea Bolognani <abologna@redhat.com>
Fri, 16 Feb 2024 14:15:55 +0000 (15:15 +0100)
committerAndrea Bolognani <abologna@redhat.com>
Mon, 19 Feb 2024 09:29:24 +0000 (10:29 +0100)
It's not portable.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
libvirt.spec.in
tests/virsh-uriprecedence
tests/virt-aa-helper-test

index af2ba20c02441664472941aef3075364ad0bf2ca..a1386590e722f033c9126f35712e55fa476d8662 100644 (file)
@@ -281,7 +281,7 @@ Release: 1%{?dist}
 License: GPL-2.0-or-later AND LGPL-2.1-only AND LGPL-2.1-or-later AND OFL-1.1
 URL: https://libvirt.org/
 
-%if %(echo %{version} | grep -q "\.0$"; echo $?) == 1
+%if %(echo %{version} | grep "\.0$" >/dev/null; echo $?) == 1
     %define mainturl stable_updates/
 %endif
 Source: https://download.libvirt.org/%{?mainturl}libvirt-%{version}.tar.xz
index fd6ce108c039370f530768fa051f1ec82d6f0b89..f141d08dfdc38a7dd35598727a35f1b7cca090ad 100755 (executable)
@@ -15,7 +15,7 @@ mock_xdg_ || framework_failure
 
 is_uri_good()
 {
-    echo "$1" | grep -q -F "$good_uri"
+    echo "$1" | grep -F "$good_uri" >/dev/null
 }
 
 test_uri_internal()
index 83f53acef6122da1f03f628bb83773da3332e0ce..9a97168330fc1726fbe1ebea145c1a74462966c0 100755 (executable)
@@ -139,7 +139,7 @@ testme() {
 
     rule_missing=0
     if [ -n "$checkrule" ]; then
-        if ! grep -q "$checkrule" "$tmpout"; then
+        if ! grep "$checkrule" "$tmpout" >/dev/null; then
             echo "FAIL: missing rule '$checkrule'" >"$output"
             rule_missing=1
         fi