chiark / gitweb /
7156d0e3dd2cf996bfe137aca77a98e5903c45bb
[dgit.git] / tests / tests / sbuild-gitish
1 #!/bin/bash
2 set -e
3 . tests/lib
4
5 t-dependencies sbuild man-db
6 t-restrict x-dgit-schroot-build
7
8 t-tstunt-parsechangelog
9
10 t-prep-newpackage example 1.1
11
12 buildrune=$(
13         (export LC_ALL=C.UTF-8
14          if [ "$DGIT_TEST_INTREE" ]; then
15                 make -C $DGIT_TEST_INTREE dgit-user.7.view
16          else
17                 man 7 dgit-user
18          fi) | \
19         perl -ne '
20                 next unless m/^ +Using sbuild$/ .. 0;
21                 next unless m/^ +\%/ .. 0;
22                 next if !m/\S/ .. 0;
23                 s/^ +\%//;
24                 $fixchr += s/(\s-c\s*)jessie(\s|$)/$1build$2/;
25                 print or die $!;
26                 END { $fixchr == 1 or die $fixchr; }
27         '
28 )
29
30 cd $p
31
32 build () {
33         eval "$buildrune"
34 }
35
36 git checkout quilt-tip-1.1~0
37
38 build
39
40 git checkout gitish-only~0
41
42 cat <<'END' >clean-target-hook
43 #!/bin/sh
44 set -ex
45 test "$SCHROOT_SESSION_ID"
46 END
47 git add clean-target-hook
48 git commit -m 'insist on schroot'
49
50 build
51
52 t-ok