chiark / gitweb /
dgit(1): Some more info about --deliberately.
[dgit.git] / tests / tests / import-nonnative
1 #!/bin/bash
2 set -e
3 . tests/lib
4
5 t-tstunt-parsechangelog
6
7 chk () {
8         p=$1
9         v=$2
10
11         t-archive $p $v
12         t-git-none
13         t-dgit --no-rm-on-error clone $p
14
15         # And now we make an update using the same orig tarball, and
16         # check that the orig import is stable.
17
18         cd $p
19
20         git branch first-import
21
22         m='Commit for import check'
23         echo "$m" >>import-check
24
25         v=${v%-*}-99
26         dch -v $v -D unstable -m "$m"
27
28         git add import-check debian/changelog
29         git commit -m "$m"
30
31         t-dgit -wgf quilt-fixup
32         t-dgit -wgf build-source
33
34         # The resulting .dsc does not have a Dgit line (because dgit push
35         # puts that in).  So we just shove it in the archive now
36
37         ln ../${p}_${v}.* $tmp/mirror/pool/main/
38         t-archive-query
39
40         t-dgit fetch
41
42         git branch first-2nd-import remotes/dgit/dgit/sid
43
44         t-git-next-date
45
46         git update-ref refs/remotes/dgit/dgit/sid first-import
47
48         t-dgit fetch
49
50         t-refs-same-start
51         t-ref-same refs/remotes/dgit/dgit/sid
52         t-ref-same refs/heads/first-2nd-import
53
54         for orig in ../${p}_${v%-*}.orig*.tar.*; do
55                 orig=${orig#../}
56                 pat="^Import ${orig//./\\.}\$"
57                 t-refs-same-start
58                 for start in first-import first-2nd-import; do
59                         git log --pretty='tformat:%H' --grep "$pat" $start \
60                                 >../t.imp
61                         test $(wc -l <../t.imp) = 1
62                         imp=$(cat ../t.imp)
63                         t-ref-same-val "$orig $start" "$imp"
64                 done
65         done
66         cd ..
67 }
68
69 # 1.0 with diff
70 chk pari-extra 3-1
71
72 # 3.0 (quilt), multiple patches, multiple origs
73 chk example 1.0-1
74
75 # 3.0 (quilt), single-debian-patch, one orig
76 chk sunxi-tools 1.2-2.~~dgittest
77
78 echo done.