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