~ubuntu-branches/ubuntu/raring/reprepro/raring

« back to all changes in this revision

Viewing changes to tests/testexporthooks.sh

  • Committer: Bazaar Package Importer
  • Author(s): Bernhard R. Link
  • Date: 2011-05-05 16:34:23 UTC
  • mfrom: (21.1.5 sid)
  • Revision ID: james.westby@ubuntu.com-20110505163423-x49kbdijyoubai4x
Tags: 4.6.0-1
* new release
- general cleanup
- new FilterSrcList
* increase Standards-Version, no changes needed

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/bin/bash
2
 
 
3
 
set -e
4
 
if [ "x$TESTINCSETUP" != "xissetup" ] ; then
5
 
        source $(dirname $0)/test.inc
6
 
fi
7
 
 
8
 
mkdir conf
9
 
cat > conf/distributions <<EOF
10
 
Codename: o
11
 
Architectures: a b
12
 
Components: e
13
 
DebIndices: .
14
 
EOF
15
 
 
16
 
testrun - -b . export o 3<<EOF
17
 
*=Error parsing ./conf/distributions, line 4, column 13: filename for index files expected!
18
 
-v0*=There have been errors!
19
 
returns 255
20
 
EOF
21
 
 
22
 
cat > conf/distributions <<EOF
23
 
Codename: o
24
 
Architectures: a b
25
 
Components: e
26
 
DebIndices: X .gz .bz2 strange.sh
27
 
EOF
28
 
cat > conf/strange.sh <<'EOF'
29
 
#!/bin/sh
30
 
echo hook "$@"
31
 
touch "$1/$3.something.new"
32
 
echo "$3.something.new" >&3
33
 
touch "$1/$3.something.hidden.new"
34
 
echo "$3.something.hidden.new." >&3
35
 
exit 0
36
 
EOF
37
 
chmod a+x conf/strange.sh
38
 
 
39
 
testrun - -b . export o 3<<EOF
40
 
stdout
41
 
-v2*=Created directory "./db"
42
 
-v1*=Exporting o...
43
 
-v2*=Created directory "./dists"
44
 
-v2*=Created directory "./dists/o"
45
 
-v2*=Created directory "./dists/o/e"
46
 
-v2*=Created directory "./dists/o/e/binary-a"
47
 
-v6*= exporting 'o|e|a'...
48
 
-v6*=  creating './dists/o/e/binary-a/X' (gzipped,bzip2ed,script: strange.sh)
49
 
*=hook ./dists/o e/binary-a/X.new e/binary-a/X new
50
 
-v2*=Created directory "./dists/o/e/binary-b"
51
 
*=hook ./dists/o e/binary-b/X.new e/binary-b/X new
52
 
-v6*= exporting 'o|e|b'...
53
 
-v6*=  creating './dists/o/e/binary-b/X' (gzipped,bzip2ed,script: strange.sh)
54
 
EOF
55
 
 
56
 
find dists -type f | sort > results
57
 
cat > results.expected <<EOF
58
 
dists/o/Release
59
 
dists/o/e/binary-a/Release
60
 
dists/o/e/binary-a/X.bz2
61
 
dists/o/e/binary-a/X.gz
62
 
dists/o/e/binary-a/X.something
63
 
dists/o/e/binary-a/X.something.hidden
64
 
dists/o/e/binary-b/Release
65
 
dists/o/e/binary-b/X.bz2
66
 
dists/o/e/binary-b/X.gz
67
 
dists/o/e/binary-b/X.something
68
 
dists/o/e/binary-b/X.something.hidden
69
 
EOF
70
 
dodiff results.expected results
71
 
 
72
 
grep  something dists/o/Release > results || true
73
 
cat > results.expected <<EOF
74
 
 $(md5releaseline o e/binary-a/X.something)
75
 
 $(md5releaseline o e/binary-b/X.something)
76
 
 $(sha1releaseline o e/binary-a/X.something)
77
 
 $(sha1releaseline o e/binary-b/X.something)
78
 
 $(sha2releaseline o e/binary-a/X.something)
79
 
 $(sha2releaseline o e/binary-b/X.something)
80
 
EOF
81
 
dodiff results.expected results
82
 
 
83
 
rm -r conf db dists
84
 
rm results results.expected
85
 
testsuccess