summaryrefslogtreecommitdiffstats
path: root/tests/copy.test
blob: 73908b6bda5ebc1b6649210226116b90f3f5d8d6 (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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
set -u
. "$TESTSDIR"/test.inc

dodo test ! -e dists
mkdir conf db logs lists

cat >> conf/distributions <<EOF
Codename: a
Architectures: abacus source
Components: one two three

Codename: b
Architectures: abacus
Components: one two four
EOF

DISTRI=a PACKAGE=aa EPOCH="" VERSION=1 REVISION="-1" FAKEVER="4-2" SECTION="one" genpackage.sh

testrun - -b . --export=never --delete --delete include a test.changes 3<<EOF
*=Warning: database 'a|one|abacus' was modified but no index file was exported.
*=Warning: database 'a|one|source' was modified but no index file was exported.
*=Changes will only be visible after the next 'export'!
stdout
-v2*=Created directory "./pool"
-v2*=Created directory "./pool/one"
-v2*=Created directory "./pool/one/a"
-v2*=Created directory "./pool/one/a/aa"
$(ofa 'pool/one/a/aa/aa-addons_4-2_all.deb')
$(ofa 'pool/one/a/aa/aa_1-1_abacus.deb')
$(ofa 'pool/one/a/aa/aa_1-1.tar.gz')
$(ofa 'pool/one/a/aa/aa_1-1.dsc')
$(opa 'aa-addons' '4-2' 'a' 'one' 'abacus' 'deb')
$(opa 'aa' '1-1' 'a' 'one' 'abacus' 'deb')
$(opa 'aa' '1-1' 'a' 'one' 'source' 'dsc')
$(otta 'a' 'aa')
-v5*=Deleting 'test.changes'.
EOF

DISTRI=a PACKAGE=aa EPOCH="" VERSION=1 REVISION="-2" FAKEVER="3-2" SECTION="two" genpackage.sh
testrun - -b . --export=never --delete --delete include a test.changes 3<<EOF
*=Warning: database 'a|two|abacus' was modified but no index file was exported.
*=Warning: database 'a|two|source' was modified but no index file was exported.
*=Changes will only be visible after the next 'export'!
stdout
-v2*=Created directory "./pool/two"
-v2*=Created directory "./pool/two/a"
-v2*=Created directory "./pool/two/a/aa"
$(ofa 'pool/two/a/aa/aa-addons_3-2_all.deb')
$(ofa 'pool/two/a/aa/aa_1-2_abacus.deb')
$(ofa 'pool/two/a/aa/aa_1-2.tar.gz')
$(ofa 'pool/two/a/aa/aa_1-2.dsc')
$(opa 'aa-addons' '3-2' 'a' 'two' 'abacus' 'deb')
$(opa 'aa' 1-2 'a' 'two' 'abacus' 'deb')
$(opa 'aa' 1-2 'a' 'two' 'source' 'dsc')
$(otta 'a' 'aa')
-v5*=Deleting 'test.changes'.
EOF

testrun - -b . ls aa 3<<EOF
stdout
*=aa | 1-1 | a | abacus, source
*=aa | 1-2 | a | abacus, source
returns 0
EOF
testrun - -b . ls aa-addons 3<<EOF
stdout
*=aa-addons | 4-2 | a | abacus
*=aa-addons | 3-2 | a | abacus
returns 0
EOF

testrun - -b . list a 3<<EOF
stdout
*=a|one|abacus: aa 1-1
*=a|one|abacus: aa-addons 4-2
*=a|one|source: aa 1-1
*=a|two|abacus: aa 1-2
*=a|two|abacus: aa-addons 3-2
*=a|two|source: aa 1-2
returns 0
EOF

testrun - -b . --export=never copy b a bb cc 3<<EOF
stderr
-v0*=Will not copy as not found: bb, cc.
stdout
-v3*=Not looking into 'a|one|source' as no matching target in 'b'!
-v3*=Not looking into 'a|two|source' as no matching target in 'b'!
-v3*=Not looking into 'a|three|abacus' as no matching target in 'b'!
-v3*=Not looking into 'a|three|source' as no matching target in 'b'!
EOF


testrun - -b . --export=never copy b a aa-addons 3<<EOF
stdout
-v3*=Not looking into 'a|one|source' as no matching target in 'b'!
-v3*=Not looking into 'a|two|source' as no matching target in 'b'!
-v3*=Not looking into 'a|three|abacus' as no matching target in 'b'!
-v3*=Not looking into 'a|three|source' as no matching target in 'b'!
-v1*=Adding 'aa-addons' '4-2' to 'b|one|abacus'.
$(opa 'aa-addons' '4-2' 'b' 'one' 'abacus' 'deb')
-v1*=Adding 'aa-addons' '3-2' to 'b|two|abacus'.
$(opa 'aa-addons' '3-2' 'b' 'two' 'abacus' 'deb')
stderr
*=Warning: database 'b|one|abacus' was modified but no index file was exported.
*=Warning: database 'b|two|abacus' was modified but no index file was exported.
*=Changes will only be visible after the next 'export'!
EOF

testrun - -b . list b 3<<EOF
stdout
*=b|one|abacus: aa-addons 4-2
*=b|two|abacus: aa-addons 3-2
returns 0
EOF

testrun - -b . ls aa 3<<EOF
stdout
*=aa | 1-1 | a | abacus, source
*=aa | 1-2 | a | abacus, source
returns 0
EOF
testrun - -b . ls aa-addons 3<<EOF
stdout
*=aa-addons | 4-2 | a | abacus
*=aa-addons | 3-2 | a | abacus
*=aa-addons | 4-2 | b | abacus
*=aa-addons | 3-2 | b | abacus
returns 0
EOF

testrun - -b . --export=never remove b aa-addons 3<<EOF
stdout
$(opd 'aa-addons' unset b one abacus deb)
$(opd 'aa-addons' unset b two abacus deb)
stderr
*=Warning: database 'b|one|abacus' was modified but no index file was exported.
*=Warning: database 'b|two|abacus' was modified but no index file was exported.
*=Changes will only be visible after the next 'export'!
EOF

testrun - -b . ls aa-addons 3<<EOF
stdout
*=aa-addons | 4-2 | a | abacus
*=aa-addons | 3-2 | a | abacus
returns 0
EOF

testrun - -b . --export=never copysrc b a aa-addons 3<<EOF
stdout
-v3*=Not looking into 'a|one|source' as no matching target in 'b'!
-v3*=Not looking into 'a|two|source' as no matching target in 'b'!
-v3*=Not looking into 'a|three|abacus' as no matching target in 'b'!
-v3*=Not looking into 'a|three|source' as no matching target in 'b'!
stderr
-v0*=Nothing to do as no package with source 'aa-addons' found!
EOF

testrun - -b . --export=never copysrc b a aa 4-2 3-2 3<<EOF
stdout
-v3*=Not looking into 'a|one|source' as no matching target in 'b'!
-v3*=Not looking into 'a|two|source' as no matching target in 'b'!
-v3*=Not looking into 'a|three|abacus' as no matching target in 'b'!
-v3*=Not looking into 'a|three|source' as no matching target in 'b'!
stderr
-v0*=Nothing to do as no packages with source 'aa' and a requested source version found!
EOF

testrun - -b . --export=never copysrc b a aa 1-1 2-2 3<<EOF
stdout
-v3*=Not looking into 'a|one|source' as no matching target in 'b'!
-v3*=Not looking into 'a|two|source' as no matching target in 'b'!
-v3*=Not looking into 'a|three|abacus' as no matching target in 'b'!
-v3*=Not looking into 'a|three|source' as no matching target in 'b'!
-v1*=Adding 'aa-addons' '4-2' to 'b|one|abacus'.
$(opa 'aa-addons' 4-2 'b' 'one' 'abacus' 'deb')
-v1*=Adding 'aa' '1-1' to 'b|one|abacus'.
$(opa 'aa' 1-1 'b' 'one' 'abacus' 'deb')
stderr
-v0*=Will not copy as not found: 2-2.
-v6*=Found versions are: 1-1.
*=Warning: database 'b|one|abacus' was modified but no index file was exported.
*=Changes will only be visible after the next 'export'!
EOF

testrun - -b . --export=never copysrc b a aa 1-1 1-2 3<<EOF
stdout
-v3*=Not looking into 'a|one|source' as no matching target in 'b'!
-v3*=Not looking into 'a|two|source' as no matching target in 'b'!
-v3*=Not looking into 'a|three|abacus' as no matching target in 'b'!
-v3*=Not looking into 'a|three|source' as no matching target in 'b'!
-v1*=Adding 'aa-addons' '4-2' to 'b|one|abacus'.
$(opu 'aa-addons' 4-2 4-2 'b' 'one' 'abacus' 'deb')
-v1*=Adding 'aa' '1-1' to 'b|one|abacus'.
$(opu 'aa' 1-1 1-1 'b' 'one' 'abacus' 'deb')
-v1*=Adding 'aa-addons' '3-2' to 'b|two|abacus'.
$(opa 'aa-addons' 3-2 'b' 'two' 'abacus' 'deb')
-v1*=Adding 'aa' '1-2' to 'b|two|abacus'.
$(opa 'aa' 1-2 'b' 'two' 'abacus' 'deb')
stderr
-v6*=Found versions are: 1-1, 1-2.
*=Warning: replacing 'aa-addons' version '4-2' with equal version '4-2' in 'b|one|abacus'!
*=Warning: replacing 'aa' version '1-1' with equal version '1-1' in 'b|one|abacus'!
*=Warning: database 'b|one|abacus' was modified but no index file was exported.
*=Warning: database 'b|two|abacus' was modified but no index file was exported.
*=Changes will only be visible after the next 'export'!
EOF

rm -r db conf pool logs lists
testsuccess