Root/qpkg/test/bug-adding

1#!/bin/sh
2. ./Common
3
4###############################################################################
5
6#
7# See the comment at the end of "resolve" in prereq.c for details.
8#
9
10qpkg_fail "BUG: we don't clean up QPKG_ADDING, yielding false errors" \
11  prereq A <<EOF
12Package: D
13Version: 0
14Architecture: test
15Conflicts: B (= 1)
16Filename: D_0
17
18Package: C
19Version: 0
20Architecture: test
21Depends: D
22Filename: C_0
23
24Package: B
25Version: 1
26Architecture: test
27Depends: C
28Filename: B_1
29
30Package: B
31Version: 0
32Architecture: test
33Depends: C
34Filename: B_0
35
36Package: A
37Version: 0
38Architecture: test
39Depends: B
40Filename: A_0
41EOF
42expect <<EOF
43package C version 0 has cyclic dependency
44EOF
45
46###############################################################################
47
48#
49# We also fail (badly) to restore QPKG_ADDING after we moved on:
50#
51# A -> B, D
52# B -> C_1
53# C_0 -> B
54# D conflicts with C_1
55#
56# "resolve" recurses as follows:
57#
58# A_0 -> B
59# B_0|D -> C
60# C_1|D -> next (we clear B here !)
61# D_0 -> done
62# C_0|D -> next (we try to clear B again)
63#
64
65qpkg_fail "BUG: we don't restore QPKG_ADDING, missing errors" \
66  prereq A <<EOF
67Package: D
68Version: 0
69Architecture: test
70Filename: D
71
72Package: C
73Version: 1
74Architecture: test
75Filename: C_1
76
77Package: C
78Version: 0
79Architecture: test
80Depends: B
81Filename: C_0
82
83Package: B
84Version: 0
85Architecture: test
86Depends: C
87Filename: B
88
89Package: A
90Version: 0
91Architecture: test
92Depends: B, D
93Filename: A
94EOF
95expect <<EOF
96qpkg: prereq.c:185: resolve: Assertion \`top->pkg->flags & QPKG_ADDING' failed.
97Aborted
98EOF
99

Archive Download this file

Branches:
master



interactive