chiark / gitweb /
abec753af6c78f1ed8df7ddf12fc7b50518462ee
[dgit.git] / tests / lib-baredebian
1 #
2
3 baredebian-test-vars () {
4         quiltmode=baredebian
5         v=1.0-1
6         suite=sid
7         uv=${v%-*}
8         uvtag=v$uv
9 }
10
11 baredebian-tarball-mode () {
12         git tag -d $uvtag
13         uvtag=''
14         quiltmode=baredebian+tarball
15 }
16
17 baredebian-test-core () {
18         t-expect-fail 'contradicts clean mode git-ff' \
19         t-dgit -wgf --dgit-view-save=split.f1 --$quiltmode quilt-fixup
20
21         t-dgit -wn --dgit-view-save=split.f1 --$quiltmode quilt-fixup
22
23         tar --strip-components=1 -axf ../${p}_${uv}.orig.tar.*
24
25         cd debian
26         git clean -xdff
27         git checkout HEAD -- .
28         cd ..
29
30         # Now we are in this insane state that people seem to expect
31
32         export QUILT_PATCHES=debian/patches
33         quilt push -a
34
35         git add -Af .
36         git reset .pc
37         git diff --cached --exit-code split.f1 -- :/ :!/debian
38         git diff --exit-code HEAD..split.f1 -- :/debian
39         git reset
40
41         quilt new made-with-quilt
42         quilt add src.c
43         echo //omg >>src.c
44         quilt refresh
45
46         git add debian/patches/.
47         t-commit 'extra patch made with quilt' 1.0-2
48
49         dpkg-buildpackage -uc -us --build=source
50         # ^ Do this by hand here not because we expect users to do this
51         #   (rather than dgit build), but so that we can check that our
52         #   output is the same as users are used to.
53
54         t-dgit -wn --quilt=$quiltmode --dgit-view-save=split.b quilt-fixup
55         t-dgit -wn --quilt=$quiltmode --dgit-view-save=split.p --new push
56
57         git merge-base --is-ancestor HEAD     split.p
58         if [ "$uvtag" ]; then
59                 git merge-base --is-ancestor $uvtag split.p
60                 set +e; git merge-base HEAD $uvtag; rc=$?; set -e; [ $rc = 1 ]
61         fi
62
63         git clean -xdff
64         # t-pushed-good-* wants a clean tree to start with, but this
65         #  workflow expects a mess
66
67         t-splitbrain-pushed-good-start
68         t-splitbrain-pushed-good--unpack
69
70         find . -mindepth 1 -maxdepth 1          \
71                 \! -path ./debian               \
72                 \! -path ./.git                 \
73                 -print0                         \
74                 | xargs -0r rm -rf --
75
76         t-splitbrain-pushed-good-end-made-dep14
77 }
78
79 baredebian-test () {
80         baredebian-test-vars
81         baredebian-test-core
82 }