From 20a72f83f0501485ccd746322957c3de2ce5c5d8 Mon Sep 17 00:00:00 2001 From: Arnaud Giersch Date: Wed, 30 Jan 2013 16:52:17 +0100 Subject: [PATCH] Add script to compare git repository and tardist. --- tools/check_dist_archive | 100 +++++++++++++++++++++++++++++++ tools/check_dist_archive.exclude | 77 ++++++++++++++++++++++++ 2 files changed, 177 insertions(+) create mode 100755 tools/check_dist_archive create mode 100644 tools/check_dist_archive.exclude diff --git a/tools/check_dist_archive b/tools/check_dist_archive new file mode 100755 index 0000000000..22c717b547 --- /dev/null +++ b/tools/check_dist_archive @@ -0,0 +1,100 @@ +#!/bin/bash + +set -e + +if [ "$1" = "-batch" ]; then + shift + interactive=0 +elif [ -t 1 ]; then + interactive=1 +else + interactive=0 +fi + +if [ $# -lt 1 -o $# -gt 3 ]; then + cat < $arch_dir" +tar --directory "$tmpdir" \ + --transform 's!^[^/]*!a!' \ + --extract --gunzip --file "$archive" + +echo "Copying git repository: $giturl/$gitbranch -> $git_dir" +git archive --format=tar --prefix="b/" --remote="$giturl" "$gitbranch" \ + | tar --directory "$tmpdir" --extract --file - + +fa=from_tgz +fb=from_git +cd "$tmpdir" + +sed -n '/^-/{s/^- //;p;}' "$exclude" > ea +sed -n '/^+/{s/^+ //;p;}' "$exclude" > eb + +find a -type f \ + | sed 's!^a/!!' \ + | grep -E -v -x -f ea \ + | sort > "$fa" +find b -type f \ + | sed 's!^b/!!' \ + | grep -E -v -x -f eb \ + | sort > "$fb" + +diffcmd() { + diff -u "$fa" "$fb" +} + +colordiff=$(type -p colordiff) +colorless() { + if [ -n "$colordiff" ]; then + "$colordiff" | less -R -F + else + less -F + fi +} + +if [ "$interactive" = "1" ]; then + diffcmd | colorless +else + diffcmd +fi diff --git a/tools/check_dist_archive.exclude b/tools/check_dist_archive.exclude new file mode 100644 index 0000000000..8339ce8a41 --- /dev/null +++ b/tools/check_dist_archive.exclude @@ -0,0 +1,77 @@ +# Expected dfferences between git repository and tardists +# +# lines beginning with '#', and empty lines are ignored +# lines beginning with '- ' are expected in archive only +# lines beginning with '+ ' are expected in git only +# each line is an extended regexp that should match full file names + +- Makefile +- doc/html/.* + ++ \.gitignore ++ README\.(coding|git) ++ mk_win-dist.sh + ++ buildtools/(jenkins|pipol)/.* + ++ contrib/.* + ++ examples/msg/actions/NAS_LU_S_4/.* ++ examples/msg/chainsend/generate_deployment_file\.rb ++ examples/msg/chord/chord3\.xml + ++ examples/smpi/MM/command_exemple ++ examples/smpi/MM/host ++ examples/smpi/NAS/.* + ++ src/simix/README_attempt_without_stack ++ src/simix/simix_network\.tla + ++ src/smpi/BUGS ++ src/smpi/fixsrc\.pl ++ src/smpi/myprintloc\.cocci ++ src/smpi/patch_source\.sh ++ src/smpi/replace_globals\.cocci ++ src/smpi/replace_static\.cocci + ++ teshsuite/smpi/mpich-test/coll/bcast2\.f ++ teshsuite/smpi/mpich-test/coll/nbcoll\.c ++ teshsuite/smpi/mpich-test/coll/shortint\.c ++ teshsuite/smpi/mpich-test/coll/temprun ++ teshsuite/smpi/mpich-test/context/attrt\.c ++ teshsuite/smpi/mpich-test/context/commnames\.c ++ teshsuite/smpi/mpich-test/env/argstest\.c ++ teshsuite/smpi/mpich-test/env/cmdline\.c ++ teshsuite/smpi/mpich-test/env/errhand2\.c ++ teshsuite/smpi/mpich-test/env/hang\.c ++ teshsuite/smpi/mpich-test/pt2pt/fairness/README ++ teshsuite/smpi/mpich-test/pt2pt/fairness/fairness-euih\.c ++ teshsuite/smpi/mpich-test/pt2pt/fairness/fairness\.c ++ teshsuite/smpi/mpich-test/pt2pt/fairness/fairness2\.c ++ teshsuite/smpi/mpich-test/pt2pt/fairness/fairness2m\.c ++ teshsuite/smpi/mpich-test/pt2pt/fairness/fairnessm\.c ++ teshsuite/smpi/mpich-test/pt2pt/isndrcv2\.c ++ teshsuite/smpi/mpich-test/pt2pt/mpitest\.h ++ teshsuite/smpi/mpich-test/pt2pt/systest\.c ++ teshsuite/smpi/mpich-test/pt2pt/systest1\.c ++ teshsuite/smpi/mpich-test/pt2pt/testhetero ++ teshsuite/smpi/mpich-test/topol/cart\.c ++ teshsuite/smpi/mpich-test/topol/cart1f\.f ++ teshsuite/smpi/mpich-test/topol/cart2\.c ++ teshsuite/smpi/mpich-test/topol/cart2f\.f ++ teshsuite/smpi/mpich-test/topol/cartc\.f90 ++ teshsuite/smpi/mpich-test/topol/cartf\.f ++ teshsuite/smpi/mpich-test/topol/cartf\.std ++ teshsuite/smpi/mpich-test/topol/cartmap\.c ++ teshsuite/smpi/mpich-test/topol/cartmap\.std ++ teshsuite/smpi/mpich-test/topol/cartorder\.c ++ teshsuite/smpi/mpich-test/topol/dims\.c ++ teshsuite/smpi/mpich-test/topol/graphtest\.c ++ teshsuite/smpi/mpich-test/topol/graphtest\.std ++ teshsuite/smpi/mpich-test/topol/test\.c ++ teshsuite/smpi/mpich-test/topol/test\.h ++ teshsuite/smpi/mpich-test/topol/twod\.f ++ teshsuite/smpi/mpich-test/topol/twod2\.f + ++ tools/check_dist_archive ++ tools/check_dist_archive\.exclude -- 2.20.1