summaryrefslogtreecommitdiff
path: root/tests/tests/gbp-orig
blob: 9a4937cb1e6f0fc91a9fd6a17d8152d45a13c709 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#!/bin/bash
set -e
. tests/lib

t-tstunt-parsechangelog
t-tstunt-debuild
t-tstunt-lintian

t-archive-none example
t-git-none
t-worktree 1.0

cd $p

: '----- construct an unpatched branch with patches -----'

git checkout patch-queue/quilt-tip
gbp pq export
: 'now on quilt-tip'
git add debian/patches
git commit -m 'Commit patch queue'

: '----- construct an upstream branch -----'

git checkout --orphan upstream
git reset --hard
git clean -xdf

tar --strip-components=1 -xf $troot/pkg-srcs/${p}_1.0.orig.tar.gz

mkdir docs
cd docs
tar --strip-components=1 -xf $troot/pkg-srcs/${p}_1.0.orig-docs.tar.gz
cd ..

git add -Af .
git commit -m 'Import 1.0'
git tag upstream/1.0

git checkout quilt-tip
t-git-pseudo-merge -m 'gbp-orig pseudomerge' upstream

v=1.0-1

: '----- let gbp build a .orig for comparison -----'

gbp buildpackage --git-ignore-branch --git-no-sign-tags -us -uc

mkdir ../gbp-output
mv ../*1.0* ../gbp-output/.
rm -f ../*.changes

: '----- now do it ourselves -----'

t-dgit -wgf --dgit-view-save=split.b gbp-build --git-ignore-branch

t-dgit -wgf --quilt=gbp clean # gbp leaves dirty trees :-/

t-dgit -wgf --dgit-view-save=split.p --quilt=gbp push --new

t-gbp-pushed-good

: '----- check .origs are the same -----'

# if gbp weren't weird about .gitignore we could just debdiff the .dscs

for d in . gbp-output; do
	cd $tmp/$d
	mkdir tar-x
	cd tar-x
	tar zxf ../${p}_${v%-*}.orig.tar.gz
done

cd $tmp
diff -ruN gbp-output/tar-x tar-x

t-ok