X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=tests%2Ftests%2Fimport-nonnative;h=838731a93bd3e648c164f4b2c234279785e6f13b;hb=3178be82907d7e3c9d49f9dfa7f03c4b4884d867;hp=98076f066d7ea44fdff11b7c01b64a766c032f24;hpb=3a434e0ecac4387bb900a078b7d65c751b99f3bb;p=dgit.git diff --git a/tests/tests/import-nonnative b/tests/tests/import-nonnative index 98076f06..838731a9 100755 --- a/tests/tests/import-nonnative +++ b/tests/tests/import-nonnative @@ -4,12 +4,15 @@ set -e t-tstunt-parsechangelog -chk () { +chk1 () { p=$1 v=$2 t-archive $p $v +} +chk2() { t-git-none + rm -rf $p t-dgit --no-rm-on-error clone $p # And now we make an update using the same orig tarball, and @@ -52,6 +55,19 @@ chk () { 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 ' + while (<>) { + m#^([^/]+/)# or exit 0; + $x //= $1; + $x eq $1 or exit 0; + } + print "$x\n"; + ') + perl -i~ -pe ' + s#^\Q'"$pfx"'\E##; + $_="" if m/^$/ || m#/$#; + ' ../files.o orig=${orig#../} pat="^Import ${orig//./\\.}\$" t-refs-same-start @@ -62,10 +78,15 @@ chk () { imp=$(cat ../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} done cd .. } +chk() { chk1 "$@"; chk2; } + # 1.0 with diff chk pari-extra 3-1 @@ -75,4 +96,37 @@ chk example 1.0-1 # 3.0 (quilt), single-debian-patch, one orig chk sunxi-tools 1.2-2.~~dgittest +mangle1 () { + rm -f ${1}_* + chk1 "$@" + cd $tmp/mirror/pool/main + dpkg-source -x ${p}_${v}.dsc td + orig=${p}_${v%-*}.orig.tar.gz + tar zxf $orig + rm $orig ${p}_${v}.* + cd $p + mkdir urk + echo urk >urk/urk + export GZIP=-1 +} +mangle2 () { + cd .. + dpkg-source -b td + rm -rf $p td + cd $tmp + t-archive-none $p + t-archive-query + chk2 +} + +# 3.0 (quilt), multiple patches, tarbomb orig +mangle1 example 1.0-1 +tar zvcf ../$orig * +mangle2 + +# 3.0 (quilt), multiple patches, tarbomb orig with dot +mangle1 example 1.0-1 +tar zvcf ../$orig . +mangle2 + echo done.