]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
tools: create libxfs-diff to compare libxfses
authorDarrick J. Wong <darrick.wong@oracle.com>
Tue, 10 Jan 2017 02:16:33 +0000 (20:16 -0600)
committerEric Sandeen <sandeen@redhat.com>
Tue, 10 Jan 2017 02:16:33 +0000 (20:16 -0600)
Create a script to compare every file in libxfs to the same files
in another libxfs.  This is useful for comparing upstream kernel
and user progs to look for unported changes.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
tools/libxfs-diff [new file with mode: 0755]

diff --git a/tools/libxfs-diff b/tools/libxfs-diff
new file mode 100755 (executable)
index 0000000..ad69c85
--- /dev/null
@@ -0,0 +1,25 @@
+#!/bin/bash
+
+if [ -z "$1" ] || [ ! -d "$1" ] || [ "$1" = "--help" ]; then
+       echo "Usage: $0 kernel_libxfs_dir"
+       exit 1
+fi
+
+if [ ! -d "libxfs/" ]; then
+       echo "$0: Must be run from the top level directory."
+       exit 2
+fi
+
+dir="$1"
+
+if [ ! -e "${dir}/xfs_format.h" ]; then
+       echo "${dir}: This doesn't seem to be a libxfs/ directory."
+       exit 3
+fi
+
+dir="$(readlink -m "${dir}/..")"
+
+for i in libxfs/xfs*.[ch]; do
+       kfile="${dir}/$i"
+       diff -Naurpw --label "$i" <(sed -e '/#include/d' "$i") --label "${kfile}" <(sed -e '/#include/d' "${kfile}")
+done