chiark / gitweb /
sbuild-gitish: New test case to check running sbuild from git
[dgit.git] / tests / tests / import-native
1 #!/bin/bash
2 set -e
3 . tests/lib
4
5 t-setup-import examplegit
6 t-tstunt-parsechangelog
7
8 mkdir $tmp/aside
9
10 versions=""
11 for f in $(find $tmp/mirror -name \*.dsc | sort); do
12         perl -i -pe '
13                 $_="" if m/^-----BEGIN PGP SIGNED/..!m/\S/;
14                 $_="" if m/^-----BEGIN PGP SIGNATURE/..0;
15                 $_="" if m/^Dgit: /;
16         ' $f
17         mv $f $tmp/aside/.
18         version="${f%.dsc}"
19         version="${version##*/${p}_}"
20         versions+=" $version"
21 done
22
23 echo $versions
24
25 rm -rf $tmp/git/$p.git
26 t-archive-none $p
27
28 cd $p
29
30 lrref=refs/remotes/dgit/dgit/sid
31
32 git update-ref -d $lrref
33
34 for v in $versions; do
35         git show-ref
36
37         mv $tmp/aside/${p}_${v}.dsc $tmp/mirror/pool/main/
38         t-archive-query
39
40         t-dgit fetch
41
42         set +e
43         git merge-base HEAD remotes/dgit/dgit/sid
44         rc=$?
45         set -e
46         test $rc = 1
47
48         t-refs-same-start
49         t-ref-same-exact refs/tags/$p/$v:
50         t-ref-same-exact refs/remotes/dgit/dgit/sid:
51
52         first_imp=first-import/$v
53         git tag first-import/$v $lrref
54
55         if [ "$lastv_imp" ]; then
56                 git update-ref $lrref $lastv_imp
57
58                 t-git-next-date
59                 t-dgit fetch
60
61                 t-refs-same-start
62                 t-ref-same $first_imp
63                 t-ref-same $lrref
64         fi
65
66         lastv_imp=$this_imp
67 done
68
69 t-ok