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