X-Git-Url: https://git.jankratochvil.net/?a=blobdiff_plain;f=bin%2Fdiffgdbdir;h=2f2ab2d4ce2de9776f4ef3168358dba79f47d9f6;hb=e2effab956fa1360ca0cf49c156ed0421d8c098d;hp=d29fa10245c8735ac72a7c92c9bb558fc5c2d70d;hpb=7d51d1c10f33e2d6fd505763f32b44353e14042c;p=nethome.git diff --git a/bin/diffgdbdir b/bin/diffgdbdir index d29fa10..2f2ab2d 100755 --- a/bin/diffgdbdir +++ b/bin/diffgdbdir @@ -2,15 +2,25 @@ x="*.log" o="" -if [ "$1" = "-r" ];then - o="-r" - shift -fi -if [ "$1" = "log" ];then - x="*.sum" - o="-r" - shift -fi +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 + break +done if [ $# != 2 ];then echo >&2 "$0 hammock/xxxxyyzzname hammock/XXXXYYZZothername" @@ -18,34 +28,42 @@ 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 $o -x "$x" $dir1 $dir2 + diffgdb $o -x rpm-qa -x "$x" $dir1 $dir2 diffed=true } +function diffit +{ + diffitraw $1/out $2/out +} -if [ -f "$1" -a ! -e "${1%.tar.xz}" ];then - ( - cd "$(dirname "$1")" - tar xJf "$(basename "$1")" - ) +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" -a ! -e "${2%.tar.xz}" ];then - ( - cd "$(dirname "$2")" - tar xJf "$(basename "$2")" - ) +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" @@ -68,6 +86,10 @@ 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" fi