chiark / gitweb /
dgit: aptget archive access method
[dgit.git] / tests / tests / gbp-orig
1 #!/bin/bash
2 set -e
3 . tests/lib
4
5 t-tstunt-parsechangelog
6
7 t-archive-none example
8 t-git-none
9 t-worktree 1.0
10
11 cd $p
12
13 : '----- construct an unpatched branch with patches -----'
14
15 git checkout patch-queue/quilt-tip
16 gbp pq export
17 : 'now on quilt-tip'
18 git add debian/patches
19 git commit -m 'Commit patch queue'
20
21 : '----- construct an upstream branch -----'
22
23 git checkout --orphan upstream
24 git reset --hard
25 git clean -xdf
26
27 tar --strip-components=1 -xf $troot/pkg-srcs/${p}_1.0.orig.tar.gz
28
29 mkdir docs
30 cd docs
31 tar --strip-components=1 -xf $troot/pkg-srcs/${p}_1.0.orig-docs.tar.gz
32 cd ..
33
34 git add -Af .
35 git commit -m 'Import 1.0'
36 git tag upstream/1.0
37
38 git checkout quilt-tip
39 t-git-pseudo-merge upstream
40
41 v=1.0-1
42
43 : '----- let gbp build a .orig for comparison -----'
44
45 gbp buildpackage --git-ignore-branch --git-no-sign-tags -us -uc
46
47 mkdir ../gbp-output
48 mv ../*1.0* ../gbp-output/.
49 rm -f ../*.changes
50
51 : '----- now do it ourselves -----'
52
53 t-dgit -wgf --dgit-view-save=split.b gbp-build --git-ignore-branch
54
55 t-dgit -wgf --quilt=gbp clean # gbp leaves dirty trees :-/
56
57 t-dgit -wgf --dgit-view-save=split.p --quilt=gbp push --new
58
59 t-gbp-pushed-good
60
61 : '----- check .origs are the same -----'
62
63 # if gbp weren't weird about .gitignore we could just debdiff the .dscs
64
65 for d in . gbp-output; do
66         cd $tmp/$d
67         mkdir tar-x
68         cd tar-x
69         tar zxf ../${p}_${v%-*}.orig.tar.gz
70 done
71
72 cd $tmp
73 diff -ruN gbp-output/tar-x tar-x
74
75 echo done.