socsvn commit: r223375 -
soc2011/gk/ino64-head/tools/tools/shlib-compat
gk at FreeBSD.org
gk at FreeBSD.org
Fri Jun 17 22:31:11 UTC 2011
Author: gk
Date: Fri Jun 17 22:31:10 2011
New Revision: 223375
URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=223375
Log:
shlib-compat: Add helper script to make comparing directories with shared libraries easier
Added:
soc2011/gk/ino64-head/tools/tools/shlib-compat/shlib-compat-dirs (contents, props changed)
Added: soc2011/gk/ino64-head/tools/tools/shlib-compat/shlib-compat-dirs
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ soc2011/gk/ino64-head/tools/tools/shlib-compat/shlib-compat-dirs Fri Jun 17 22:31:10 2011 (r223375)
@@ -0,0 +1,45 @@
+#!/bin/sh -e
+
+SHLIB_COMPAT=$(dirname $0)/shlib-compat
+
+if [ $# -ne 3 ]; then
+ echo "Usage: $0 orig-dir new-dir output-dir"
+ exit 1
+fi
+
+orig=$1
+new=$2
+out=$3
+
+remove_empty() {
+ local i
+ for i in $*; do
+ [ -s $i ] || rm -f $i
+ done
+}
+
+test_file() {
+ local i
+ for i in $*; do
+ if [ \! -f $1 ]; then
+ echo "file not found: $1"
+ return 1
+ fi
+ done
+}
+
+rorig=`realpath $orig`
+rnew=`realpath $new`
+list=`(cd $rorig; ls; cd $rnew; ls) | sort -u`
+for i in $list; do
+ echo $i
+ test_file $orig/$i $new/$i || continue
+ $SHLIB_COMPAT --out-orig $out/$i.orig.c --out-new $out/$i.new.c -v \
+ $orig/$i $new/$i > $out/$i.cmp 2> $out/$i.err || true
+ remove_empty $out/$i.orig.c $out/$i.new.c $out/$i.cmp $out/$i.err
+ if [ -f $out/$i.orig.c -a -f $out/$i.new.c ]; then
+ astyle --quiet --style=bsd -k3 $out/$i.orig.c $out/$i.new.c
+ rm -f $out/$i.orig.c.orig $out/$i.new.c.orig
+ diff -u $out/$i.orig.c $out/$i.new.c > $out/$i.diff || true
+ fi
+done
More information about the svn-soc-all
mailing list