Unify diffgdbfilt into diffgdb.
[nethome.git] / bin / diffgdbdir
index 861ba02..d29fa10 100755 (executable)
@@ -1,8 +1,14 @@
 #! /bin/sh
 
 x="*.log"
+o=""
+if [ "$1" = "-r" ];then
+       o="-r"
+       shift
+fi
 if [ "$1" = "log" ];then
        x="*.sum"
+       o="-r"
        shift
 fi
 
@@ -20,10 +26,33 @@ function diffit
                echo "MISSING: $dir1 $dir2"
                return
        fi
-       diffgdb -x "$x" $dir1 $dir2
+       diffgdb $o -x "$x" $dir1 $dir2
        diffed=true
 }
 
+if [ -f "$1" -a ! -e "${1%.tar.xz}" ];then
+       (
+               cd "$(dirname "$1")"
+               tar xJf "$(basename "$1")"
+       )
+       set "${1%.tar.xz}" "$2"
+       if [ ! -d "$1" ];then
+               echo "! $1"
+               exit 1
+       fi
+fi
+if [ -f "$2" -a ! -e "${2%.tar.xz}" ];then
+       (
+               cd "$(dirname "$2")"
+               tar xJf "$(basename "$2")"
+       )
+       set "$1" "${2%.tar.xz}"
+       if [ ! -d "$2" ];then
+               echo "! $2"
+               exit 1
+       fi
+fi
+
 for arch in x86_64 i386;do
        if [ -d $1-$arch ];then
                diffit $1-$arch $2-$arch
@@ -37,6 +66,7 @@ for arch in x86_64 i386;do
 done
 if [ -d $1/out ];then
        diffit $1 $2
+       diffed=true
 fi
 if ! $diffed;then
        echo "NOT FOUND: $1 $2"