[libvirt PATCH] scripts: ignore whitespace in pdwtags output

Daniel P. Berrangé posted 1 patch 3 years, 5 months ago
Test syntax-check failed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/20201202102242.207358-1-berrange@redhat.com
scripts/check-remote-protocol.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[libvirt PATCH] scripts: ignore whitespace in pdwtags output
Posted by Daniel P. Berrangé 3 years, 5 months ago
The pdwtags program changed its whitespace formatting for enum
values in release 1.19:

  @@ -145,22 +145,22 @@
           u_int                      flags;
   };
   enum admin_procedure {
  -        ADMIN_PROC_CONNECT_OPEN = 1,
  -        ADMIN_PROC_CONNECT_CLOSE = 2,
  -        ADMIN_PROC_CONNECT_GET_LIB_VERSION = 3,
  -        ADMIN_PROC_CONNECT_LIST_SERVERS = 4,
  -        ADMIN_PROC_CONNECT_LOOKUP_SERVER = 5,
  +        ADMIN_PROC_CONNECT_OPEN                     = 1,
  +        ADMIN_PROC_CONNECT_CLOSE                    = 2,
  +        ADMIN_PROC_CONNECT_GET_LIB_VERSION          = 3,
  +        ADMIN_PROC_CONNECT_LIST_SERVERS             = 4,
  +        ADMIN_PROC_CONNECT_LOOKUP_SERVER            = 5,

Workaround this by telling diff to ignore whitespace changes.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
---
 scripts/check-remote-protocol.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/check-remote-protocol.py b/scripts/check-remote-protocol.py
index cd96e894a7..40c4b481be 100644
--- a/scripts/check-remote-protocol.py
+++ b/scripts/check-remote-protocol.py
@@ -121,7 +121,7 @@ if n < 1:
     print("WARNING: install dwarves-1.3 or newer", file=sys.stderr)
     sys.exit(8)
 
-diff = subprocess.Popen(["diff", "-u", expected, "-"], stdin=subprocess.PIPE)
+diff = subprocess.Popen(["diff", "-b", "-u", expected, "-"], stdin=subprocess.PIPE)
 actualstr = "\n".join(actual) + "\n"
 # i686 builds on x86_64 host add __attribute__(packed)) to
 # the structs. This doesn't matter functionally because we
-- 
2.25.4

Re: [libvirt PATCH] scripts: ignore whitespace in pdwtags output
Posted by Ján Tomko 3 years, 5 months ago
On a Wednesday in 2020, Daniel P. Berrangé wrote:
>The pdwtags program changed its whitespace formatting for enum
>values in release 1.19:
>
>  @@ -145,22 +145,22 @@
>           u_int                      flags;
>   };
>   enum admin_procedure {
>  -        ADMIN_PROC_CONNECT_OPEN = 1,
>  -        ADMIN_PROC_CONNECT_CLOSE = 2,
>  -        ADMIN_PROC_CONNECT_GET_LIB_VERSION = 3,
>  -        ADMIN_PROC_CONNECT_LIST_SERVERS = 4,
>  -        ADMIN_PROC_CONNECT_LOOKUP_SERVER = 5,
>  +        ADMIN_PROC_CONNECT_OPEN                     = 1,
>  +        ADMIN_PROC_CONNECT_CLOSE                    = 2,
>  +        ADMIN_PROC_CONNECT_GET_LIB_VERSION          = 3,
>  +        ADMIN_PROC_CONNECT_LIST_SERVERS             = 4,
>  +        ADMIN_PROC_CONNECT_LOOKUP_SERVER            = 5,
>
>Workaround this by telling diff to ignore whitespace changes.
>
>Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
>---
> scripts/check-remote-protocol.py | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>

Reviewed-by: Ján Tomko <jtomko@redhat.com>

Jano