X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=dgit.git;a=blobdiff_plain;f=tests%2Flib-import-chk;h=e18f66e5b99e560978a1da127e536db23f0f3daa;hp=ee33cbefa431bbd36382ebfbca64be4836d97c88;hb=08e1656e5fdb1899346dbb7ca5f57e78d412bc2a;hpb=f773b1ed2796196e0fa801886fce493544c38fe0 diff --git a/tests/lib-import-chk b/tests/lib-import-chk index ee33cbef..e18f66e5 100644 --- a/tests/lib-import-chk +++ b/tests/lib-import-chk @@ -1,4 +1,15 @@ +t-import-chk-authorship () { + perl -ne 'print $1,"\n" if m/^ -- (\S.*\>) /' debian/changelog \ + | t-sort -u \ + > $tmp/authorship.changelog + ${import_chk_changelog_massage:-:} $tmp/authorship.changelog + git log --pretty=format:'%an <%ae>%n%cn <%ce>' \ + | t-sort -u \ + > $tmp/authorship.commits + diff $tmp/authorship.{changelog,commits} +} + t-import-chk1 () { p=$1 v=$2 @@ -15,6 +26,8 @@ t-import-chk2() { cd $p + t-import-chk-authorship + git branch first-import m='Commit for import check' @@ -32,7 +45,7 @@ t-import-chk2() { # The resulting .dsc does not have a Dgit line (because dgit push # puts that in). So we just shove it in the archive now - ln ../${p}_${v}.* $tmp/mirror/pool/main/ + ln $bpd/${p}_${v}.* $tmp/mirror/pool/main/ t-archive-query t-dgit fetch @@ -49,9 +62,9 @@ t-import-chk2() { t-ref-same refs/remotes/dgit/dgit/sid t-ref-same refs/heads/first-2nd-import - for orig in ../${p}_${v%-*}.orig*.tar.*; do - tar -atf $orig | LC_ALL=C sort >../files.o - pfx=$(perl <../files.o -ne ' + for orig in $bpd/${p}_${v%-*}.orig*.tar.*; do + tar -atf $orig | t-sort >$bpd/files.o + pfx=$(perl <$bpd/files.o -ne ' while (<>) { m#^([^/]+/)# or exit 0; $x //= $1; @@ -62,20 +75,20 @@ t-import-chk2() { perl -i~ -pe ' s#^\Q'"$pfx"'\E##; $_="" if m/^$/ || m#/$# || m#^\.git/#; - ' ../files.o - orig=${orig#../} + ' $bpd/files.o + orig=${orig#$bpd/} pat="^Import ${orig//./\\.}\$" t-refs-same-start for start in first-import first-2nd-import; do git log --pretty='tformat:%H' --grep "$pat" $start \ - >../t.imp - test $(wc -l <../t.imp) = 1 - imp=$(cat ../t.imp) + >$bpd/t.imp + test $(wc -l <$bpd/t.imp) = 1 + imp=$(cat $bpd/t.imp) t-ref-same-val "$orig $start" "$imp" done git ls-tree -r --name-only "$t_ref_val:" \ - | sort >../files.g - diff ../files.{o,g} + | t-sort >$bpd/files.g + diff $bpd/files.{o,g} done cd .. }