[libvirt] [PATCH] m4: Improve portability for non-bash shells

Maya Rashish posted 1 patch 4 years, 5 months ago
Test syntax-check passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/20191019114633.GA20571@SDF.ORG
m4/virt-nls.m4 | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
[libvirt] [PATCH] m4: Improve portability for non-bash shells
Posted by Maya Rashish 4 years, 5 months ago
= and == are both operators to test for string equality in bash,
but only = is required by POSIX.

Signed-off-by: Maya Rashish <coypu@sdf.org>
---
 m4/virt-nls.m4 | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/m4/virt-nls.m4 b/m4/virt-nls.m4
index be3c53fe4d..fd8707033a 100644
--- a/m4/virt-nls.m4
+++ b/m4/virt-nls.m4
@@ -26,7 +26,7 @@ AC_DEFUN([LIBVIRT_CHECK_NLS],[
   then
     AC_CHECK_FUNC([gettext], [], [
       AC_CHECK_LIB([intl], [gettext], [], [
-        if test "x$enable_nls" == "xcheck"
+        if test "x$enable_nls" = "xcheck"
 	then
 	  enable_nls=no
 	else
@@ -39,7 +39,7 @@ AC_DEFUN([LIBVIRT_CHECK_NLS],[
   if test "x$enable_nls" != "xno"
   then
     AC_CHECK_HEADERS([libintl.h], [enable_nls=yes],[
-      if test "x$enable_nls" == "xcheck"
+      if test "x$enable_nls" = "xcheck"
       then
         enable_nls=no
       else
-- 
2.23.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [PATCH] m4: Improve portability for non-bash shells
Posted by Andrea Bolognani 4 years, 5 months ago
On Sat, 2019-10-19 at 11:46 +0000, Maya Rashish wrote:
> = and == are both operators to test for string equality in bash,
> but only = is required by POSIX.
> 
> Signed-off-by: Maya Rashish <coypu@sdf.org>
> ---
>  m4/virt-nls.m4 | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Welp, I'm surprised nobody noticed until now: the code in question
has been merged more than a year ago.

Anyway, your fix is correct, so

  Reviewed-by: Andrea Bolognani <abologna@redhat.com>

and pushed.

Congratulation on your first libvirt contribution! :)

-- 
Andrea Bolognani / Red Hat / Virtualization

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list