test/symbols-leak-test.bash: make it easier to read
authorRan Benita <ran234@gmail.com>
Thu, 3 Aug 2017 10:38:14 +0000 (13:38 +0300)
committerRan Benita <ran234@gmail.com>
Thu, 3 Aug 2017 10:38:14 +0000 (13:38 +0300)
Signed-off-by: Ran Benita <ran234@gmail.com>
test/symbols-leak-test.bash

index bf03790..0a74c5f 100755 (executable)
@@ -1,24 +1,16 @@
 #!/usr/bin/env bash
 set -e
 
-# Check that all exported symbols are specified in the symbol
-# version scripts.  If this fails, please update the appropriate
-# (adding new version nodes when needed).
+# Check that all exported symbols are specified in the symbol version
+# scripts.  If this fails, please update the appropriate .map file
+# (adding new version nodes as needed).
 
 # xkbcommon symbols
 diff -a -u \
-    <(cat "$top_srcdir"/xkbcommon.map | \
-        grep '^\s\+xkb_.*' | \
-        sed -e 's/^\s\+\(.*\);/\1/' | sort) \
-    <(cat "$top_srcdir"/src/{,xkbcomp,compose}/*.c | \
-        grep XKB_EXPORT -A 1 | grep '^xkb_.*' | \
-        sed -e 's/(.*//' | sort)
+    <(grep -h '^\s\+xkb_' "$top_srcdir"/xkbcommon.map | sed -e 's/^\s\+\(.*\);/\1/' | sort) \
+    <(grep -h 'XKB_EXPORT' -A1 "$top_srcdir"/src/{,xkbcomp,compose}/*.c | grep '^xkb_' | sed -e 's/(.*//' | sort)
 
 # xkbcommon-x11 symbols
 diff -a -u \
-    <(cat "$top_srcdir"/xkbcommon-x11.map | \
-        grep '^\s\+xkb_.*' | \
-        sed -e 's/^\s\+\(.*\);/\1/' | sort) \
-    <(cat "$top_srcdir"/src/x11/*.c | \
-        grep XKB_EXPORT -A 1 | grep '^xkb_.*' | \
-        sed -e 's/(.*//' | sort)
+    <(grep -h '^\s\+xkb_.*' "$top_srcdir"/xkbcommon-x11.map | sed -e 's/^\s\+\(.*\);/\1/' | sort) \
+    <(grep -h 'XKB_EXPORT' -A1 "$top_srcdir"/src/x11/*.c | grep '^xkb_' | sed -e 's/(.*//' | sort)