[PATCHv2 2/2] build: update to latest gnulib

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



* .gnulib: Update to latest, for improved 'make syntax-check' and
compiler warnings.
* m4/virt-compile-warnings.m4 (LIBVIRT_COMPILE_WARNINGS):
Re-silence -Wformat-nonliteral.
* cfg.mk (_test_script_regex): Recognize our test scripts.
* gnulib/local/lib/*.diff: Drop, now that gnulib has this.
* tests/virsh-optparse: Fix use of compare.
* tests/virsh-schedinfo: Likewise.
---

v2: slightly newer gnulib; drop changes for unsuffixed float
warning, and add fixes for misuse of 'compare' in tests.

 .gnulib                         |    2 +-
 cfg.mk                          |    3 +++
 gnulib/local/lib/openpty.c.diff |   26 --------------------------
 gnulib/local/lib/pty.in.h.diff  |   13 -------------
 m4/virt-compile-warnings.m4     |    8 ++++++--
 tests/virsh-optparse            |   10 +++++-----
 tests/virsh-schedinfo           |    6 +++---
 7 files changed, 18 insertions(+), 50 deletions(-)
 delete mode 100644 gnulib/local/lib/openpty.c.diff
 delete mode 100644 gnulib/local/lib/pty.in.h.diff

diff --git a/.gnulib b/.gnulib
index e56e96f..a5f6df2 160000
--- a/.gnulib
+++ b/.gnulib
@@ -1 +1 @@
-Subproject commit e56e96fe20f72586e9ec5c528b9a9a06daa2ecc6
+Subproject commit a5f6df2b1f3f0fdc73635de3ad285d21703dab18
diff --git a/cfg.mk b/cfg.mk
index 574c7a4..817b5f3 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -36,6 +36,9 @@ generated_files = \
   $(srcdir)/src/remote/*_protocol.[ch] \
   $(srcdir)/gnulib/lib/*.[ch]

+# We haven't converted all scripts to using gnulib's init.sh yet.
+_test_script_regex = \<\(init\|test-lib\)\.sh\>
+
 # Tests not to run as part of "make distcheck".
 local-checks-to-skip =			\
   changelog-check			\
diff --git a/gnulib/local/lib/openpty.c.diff b/gnulib/local/lib/openpty.c.diff
deleted file mode 100644
index f17e566..0000000
--- a/gnulib/local/lib/openpty.c.diff
+++ /dev/null
@@ -1,26 +0,0 @@
-diff --git c/lib/openpty.c i/lib/openpty.c
-index c398db5..d61d5ba 100644
---- c/lib/openpty.c
-+++ i/lib/openpty.c
-@@ -32,6 +32,21 @@ rpl_openpty (int *amaster, int *aslave, char *name,
-                   (struct winsize *) winp);
- }
-
-+#elif (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ /* mingw */
-+
-+# include <errno.h>
-+
-+int
-+openpty (int *amaster _GL_UNUSED, int *aslave _GL_UNUSED,
-+         char *name _GL_UNUSED,
-+         struct termios const *termp _GL_UNUSED,
-+         struct winsize const *winp _GL_UNUSED)
-+{
-+  /* Mingw lacks pseudo-terminals altogether.  */
-+  errno = ENOSYS;
-+  return -1;
-+}
-+
- #else /* AIX 5.1, HP-UX 11, IRIX 6.5, Solaris 10, mingw */
-
- # include <fcntl.h>
diff --git a/gnulib/local/lib/pty.in.h.diff b/gnulib/local/lib/pty.in.h.diff
deleted file mode 100644
index 9470700..0000000
--- a/gnulib/local/lib/pty.in.h.diff
+++ /dev/null
@@ -1,13 +0,0 @@
-diff --git c/lib/pty.in.h i/lib/pty.in.h
-index aff989c..00eecc6 100644
---- c/lib/pty.in.h
-+++ i/lib/pty.in.h
-@@ -92,6 +92,8 @@ _GL_WARN_ON_USE (forkpty, "forkpty is not declared consistently - "
- /* Create pseudo tty master slave pair and set terminal attributes
-    according to TERMP and WINP.  Return handles for both ends in
-    *AMASTER and *ASLAVE, and return the name of the slave end in NAME.  */
-+struct termios;
-+struct winsize;
- # if @REPLACE_OPENPTY@
- #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
- #   undef openpty
diff --git a/m4/virt-compile-warnings.m4 b/m4/virt-compile-warnings.m4
index 305036f..213b3db 100644
--- a/m4/virt-compile-warnings.m4
+++ b/m4/virt-compile-warnings.m4
@@ -55,8 +55,8 @@ AC_DEFUN([LIBVIRT_COMPILE_WARNINGS],[
         # Things like virAsprintf mean we can't use this
         dontwarn="$dontwarn -Wformat-nonliteral"

-        # We might fundamentally need some of these disabled forever, but ideally
-        # we'd turn many of them on
+        # We might fundamentally need some of these disabled forever, but
+        # ideally we'd turn many of them on
         dontwarn="$dontwarn -Wfloat-equal"
         dontwarn="$dontwarn -Wdeclaration-after-statement"
         dontwarn="$dontwarn -Wcast-qual"
@@ -88,6 +88,10 @@ AC_DEFUN([LIBVIRT_COMPILE_WARNINGS],[
         # that one off, so we need to manually enable this again
         gl_WARN_ADD([-Wjump-misses-init])

+        # GNULIB turns on -Wformat=2 which implies -Wformat-nonliteral,
+        # so we need to manually re-exclude it.
+        gl_WARN_ADD([-Wno-format-nonliteral])
+
         # This should be < 256 really. Currently we're down to 4096,
         # but using 1024 bytes sized buffers (mostly for virStrerror)
         # stops us from going down further
diff --git a/tests/virsh-optparse b/tests/virsh-optparse
index d0d4329..fc2279f 100755
--- a/tests/virsh-optparse
+++ b/tests/virsh-optparse
@@ -65,7 +65,7 @@ for args in \
     '--count=2 test' \
 ; do
   virsh -d0 -c $test_url setvcpus $args >out 2>>err || fail=1
-  LC_ALL=C sort out | compare - exp-out || fail=1
+  LC_ALL=C sort out | compare exp-out - || fail=1
 done

 # Another complex parsing example
@@ -84,7 +84,7 @@ EOF
 virsh -q -c $test_url snapshot-create-as --print-xml test \
   --diskspec 'vda,file=a&b,,c,snapshot=external' --description '1<2' \
   --diskspec vdb >out 2>>err || fail=1
-compare out exp-out || fail=1
+compare exp-out out || fail=1

 cat <<\EOF > exp-out || framework_failure
 <domainsnapshot>
@@ -98,7 +98,7 @@ cat <<\EOF > exp-out || framework_failure
 EOF
 virsh -q -c $test_url snapshot-create-as  --print-xml test name vda vdb \
   >out 2>>err || fail=1
-compare out exp-out || fail=1
+compare exp-out out || fail=1

 cat <<\EOF > exp-out || framework_failure
 <domainsnapshot>
@@ -122,7 +122,7 @@ for args in \
 ; do
   virsh -q -c $test_url snapshot-create-as --print-xml $args \
     >out 2>>err || fail=1
-  compare out exp-out || fail=1
+  compare exp-out out || fail=1
 done

 test -s err && fail=1
@@ -133,6 +133,6 @@ error: this function is not supported by the connection driver: virDomainQemuMon
 EOF
 virsh -q -c $test_url qemu-monitor-command test a >out 2>err && fail=1
 test -s out && fail=1
-compare err exp-err || fail=1
+compare exp-err err || fail=1

 (exit $fail); exit $fail
diff --git a/tests/virsh-schedinfo b/tests/virsh-schedinfo
index 9d885ee..8ea4ce4 100755
--- a/tests/virsh-schedinfo
+++ b/tests/virsh-schedinfo
@@ -1,7 +1,7 @@
 #!/bin/sh
 # Ensure that virsh schedinfo --set invalid=val fails

-# Copyright (C) 2010 Red Hat, Inc.
+# Copyright (C) 2010-2011 Red Hat, Inc.

 # This program is free software: you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -43,7 +43,7 @@ fail=0
 test_url=test:///default

 virsh -c $test_url schedinfo 1 --set j=k >out 2>err && fail=1
-compare out exp-out || fail=1
-compare err exp-err || fail=1
+compare exp-out out || fail=1
+compare exp-err err || fail=1

 (exit $fail); exit $fail
-- 
1.7.7.3

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


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]