5 t-dependencies bsdgames
6 t-dependencies man-db git-man
7 t-tstunt-parsechangelog
14 : ----- prepare badnesses -----
21 echo >>af/$filename "Test file with $attrspec"
22 printf >>af/$filename 'crlf: \r\n'
23 echo >>af/$filename 'id $Id: $'
24 echo >>af/$filename 'id $Id: SPLARK $'
25 echo >>gitattrs "af/$filename" "$attrspec"
30 badattr1 $attrname-set $attrname
31 badattr1 $attrname-unset -$attrname
32 badattr1 $attrname-unspec \!$attrname
35 badattr1 $attrname=$val $attrname=$val
39 # xxx want to make each of these files into a quilt patch
41 t-git-config core.eol crlf
47 t-git-config filter.dgit-test-crazy-f.smudge '/usr/games/rot13 2'
48 t-git-config filter.dgit-test-crazy-f.clean '/usr/games/rot13 24'
49 t-git-config filter.dgit-test-crazy-f.requrired true
51 badattr filter dgit-test-crazy-f
54 badattr merge text binary union
59 badattr encoding no-such-encoding
62 | perl -ne 'print $1,"\n" if m/^ *(\w[-a-z]*)$/' \
72 # ----- common to source formats -----
80 local addpatch=${sfmt}_addpatch
81 local convert=${sfmt}_convert
92 cp ../gitattrs .gitattributes
107 # caller should cd into working directory, set
109 # and check out $branch
111 sha256sum af/* >../$sums.checkout
112 diff -U0 ../sums ../$sums.checkout
115 git cat-file blob "refs/heads/$branch:$f" \
117 | sed -e 's#-$#'$f'#' \
121 diff -U0 ../sums ../$sums
124 t-dgit-warn-check () {
125 local warnok=$1; shift
126 # warnok should be 0 if the warning is expected
127 # 1 if the warning is NOT expected
131 LC_MESSAGES=C t-dgit "$@" 2>&1 |tee ../$err
134 fgrep 'warning: source tree contains .gitattributes' ../$err
138 test "$rc" = "$warnok"
144 branch="import.$sfmt-$inst"
146 sums=sums.$sfmt-$inst
153 t-dgit-warn-check 0 $dgitargs import-dsc ../$dscf +$branch.broken
155 git checkout $branch.broken
156 sha256sum af/* >../$sums.broken
158 for s in ../sums ../$sums.broken; do
159 sed 's/[0-9a-f]* //' $s >$s.nosums
161 diff -U0 ../sums.nosums ../$sums.broken.nosums
163 diff -U0 ../sums ../$sums.broken
168 t-dgit setup-new-tree
170 t-dgit $dgitargs import-dsc ../$dscf +$branch
179 : ----- generate the orig -----
181 origtar=${p}_${bv}.orig.tar.gz
183 tar --exclude=debian --exclude=.git -zcf $origtar $p
185 : ----- test 1.0 native -----
187 native_addpatch () { :; }
188 native_convert () { :; }
190 sfmt_setup 1.1 native
193 : ----- test 1.0 diff -----
195 diff_addpatch () { :; }
196 diff_convert () { :; }
201 : ----- test "3.0 (quilt)" -----
205 cat >../editor.pl <<END
207 s{^(description:).*}{\$1 dgit test patch $pname}i;
210 EDITOR="perl -pi $tmp/editor.pl" dpkg-source -iX --commit . $pname
211 test -f debian/patches/$pname
215 mkdir -p debian/source
216 echo '3.0 (quilt)' >debian/source/format
219 sfmt_setup 1.0-1 quilt
221 sfmt_import absurd --force-import-gitapply-absurd