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