X-Git-Url: https://git.jankratochvil.net/?p=nethome.git;a=blobdiff_plain;f=bin%2Fdiffgdbdir;h=ad1095897300efbb7981b3962424063e0f15ded7;hp=861ba020a66c990d4f8f0fe4e4808bba3fd12446;hb=a944ea1b26260df7f1830305624d3f59ba7c4e1f;hpb=ee2604be2545bf1c77d421a8e6570ab69cd34b5d diff --git a/bin/diffgdbdir b/bin/diffgdbdir index 861ba02..ad10958 100755 --- a/bin/diffgdbdir +++ b/bin/diffgdbdir @@ -1,10 +1,32 @@ #! /bin/sh x="*.log" -if [ "$1" = "log" ];then - x="*.sum" - shift -fi +x2="foobar" +o="" +while true;do + if [ "$1" = "-r" ];then + o="$o -r" + shift + continue + fi + if [ "$1" = "-N" ];then + o="$o -N" + shift + continue + fi + if [ "$1" = "log" -o "$1" = "-l" ];then + x="*.sum" + o="-r" + shift + continue + fi + if [ "$1" = "pie" ];then + x2="*pie*" + shift + continue + fi + break +done if [ $# != 2 ];then echo >&2 "$0 hammock/xxxxyyzzname hammock/XXXXYYZZothername" @@ -12,17 +34,48 @@ if [ $# != 2 ];then fi diffed=false -function diffit +function diffitraw { - dir1=$1/out - dir2=$2/out + dir1=$1 + dir2=$2 if [ ! -e "$dir2" ];then echo "MISSING: $dir1 $dir2" return fi - diffgdb -x "$x" $dir1 $dir2 + diffgdb $o -x rpm-qa -x "$x" -x "$x2" $dir1 $dir2 diffed=true } +function diffit +{ + diffitraw $1/out $2/out +} + +if [ -f "$1" ];then + if [ ! -e "${1%.tar.xz}" ];then + ( + cd "$(dirname "$1")" + tar xJf "$(basename "$1")" + ) + fi + set "${1%.tar.xz}" "$2" + if [ ! -d "$1" ];then + echo "! $1" + exit 1 + fi +fi +if [ -f "$2" ];then + if [ ! -e "${2%.tar.xz}" ];then + ( + cd "$(dirname "$2")" + tar xJf "$(basename "$2")" + ) + fi + 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 @@ -37,7 +90,13 @@ for arch in x86_64 i386;do done if [ -d $1/out ];then diffit $1 $2 + diffed=true +fi +if [ "$1" != "${1#tests/}" -a -d $1 ];then + diffitraw $1 $2 + diffed=true fi if ! $diffed;then - echo "NOT FOUND: $1 $2" + diffitraw $1 $2 + #echo "NOT FOUND: $1 $2" fi