aboutsummaryrefslogtreecommitdiff
path: root/paludis/resolver/resolver_TEST_blockers_setup.sh
blob: 51813e421442163bcd37e44baedd60fde1a25a10 (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
211
212
213
#!/usr/bin/env bash
# vim: set ft=sh sw=4 sts=4 et :

mkdir resolver_TEST_blockers_dir || exit 1
cd resolver_TEST_blockers_dir || exit 1

mkdir -p build
mkdir -p distdir
mkdir -p installed

mkdir -p repo/{profiles/profile,metadata}

cd repo
echo "repo" > profiles/repo_name
: > metadata/categories.conf

: > profiles/categories
cat <<'END' > profiles/profile/make.defaults
ARCH=test
END

# hard
echo 'hard' >> metadata/categories.conf

mkdir -p 'packages/hard/target'
cat <<END > packages/hard/target/target-1.exheres-0
SUMMARY="target"
PLATFORMS="test"
SLOT="0"
DEPENDENCIES="
    ( !hard/a-pkg[<2] !hard/z-pkg[<2] )
    "
END

mkdir -p 'packages/hard/a-pkg'
cat <<END > packages/hard/a-pkg/a-pkg-2.exheres-0
SUMMARY="dep"
PLATFORMS="test"
SLOT="0"
END

mkdir -p 'packages/hard/z-pkg'
cat <<END > packages/hard/z-pkg/z-pkg-2.exheres-0
SUMMARY="dep"
PLATFORMS="test"
SLOT="0"
END

# unfixable
echo 'unfixable' >> metadata/categories.conf

mkdir -p 'packages/unfixable/target'
cat <<END > packages/unfixable/target/target-1.exheres-0
SUMMARY="target"
PLATFORMS="test"
SLOT="0"
DEPENDENCIES="
    ( !unfixable/a-pkg )
    "
END

mkdir -p 'packages/unfixable/a-pkg'
cat <<END > packages/unfixable/a-pkg/a-pkg-2.exheres-0
SUMMARY="dep"
PLATFORMS="test"
SLOT="0"
END

# remove
echo 'remove' >> metadata/categories.conf

mkdir -p 'packages/remove/target'
cat <<END > packages/remove/target/target-1.exheres-0
SUMMARY="target"
PLATFORMS="test"
SLOT="0"
DEPENDENCIES="
    ( !remove/a-pkg !remove/z-pkg )
    "
END

mkdir -p 'packages/remove/a-pkg'
cat <<END > packages/remove/a-pkg/a-pkg-2.exheres-0
SUMMARY="dep"
PLATFORMS="test"
SLOT="0"
END

mkdir -p 'packages/remove/z-pkg'
cat <<END > packages/remove/z-pkg/z-pkg-2.exheres-0
SUMMARY="dep"
PLATFORMS="test"
SLOT="0"
END

# blocked-and-dep
echo 'blocked-and-dep' >> metadata/categories.conf

mkdir -p 'packages/blocked-and-dep/target'
cat <<END > packages/blocked-and-dep/target/target-1.exheres-0
SUMMARY="target"
PLATFORMS="test"
SLOT="0"
DEPENDENCIES="
    ( !blocked-and-dep/both blocked-and-dep/both )
    "
END

mkdir -p 'packages/blocked-and-dep/both'
cat <<END > packages/blocked-and-dep/both/both-1.exheres-0
SUMMARY="dep"
PLATFORMS="test"
SLOT="0"
END

# block-and-dep-cycle
echo 'block-and-dep-cycle' >> metadata/categories.conf

mkdir -p 'packages/block-and-dep-cycle/target'
cat <<END > packages/block-and-dep-cycle/target/target-1.ebuild
EAPI="2"
DESCRIPTION="target"
KEYWORDS="test"
SLOT="0"
DEPEND="
    block-and-dep-cycle/dep
    "
END

mkdir -p 'packages/block-and-dep-cycle/dep'
cat <<END > packages/block-and-dep-cycle/dep/dep-1.ebuild
EAPI="2"
DESCRIPTION="dep"
KEYWORDS="test"
SLOT="0"
DEPEND="
    !=block-and-dep-cycle/target-0
    "
END

# hard-block-and-dep-cycle
echo 'hard-block-and-dep-cycle' >> metadata/categories.conf

mkdir -p 'packages/hard-block-and-dep-cycle/target'
cat <<END > packages/hard-block-and-dep-cycle/target/target-1.ebuild
EAPI="2"
DESCRIPTION="target"
KEYWORDS="test"
SLOT="0"
DEPEND="
    hard-block-and-dep-cycle/dep
    "
END

mkdir -p 'packages/hard-block-and-dep-cycle/dep'
cat <<END > packages/hard-block-and-dep-cycle/dep/dep-1.ebuild
EAPI="2"
DESCRIPTION="dep"
KEYWORDS="test"
SLOT="0"
DEPEND="
    !!=hard-block-and-dep-cycle/target-0
    "
END

# self-block
for i in "x" "0" "1" ; do
    for d in "x" "0" "1" ; do
        for b in "w" "s" ; do
            cat=self-block-${i}-${d}-${b}

            dep=${cat}/dep

            if [[ "${d}" != "x" ]] ; then
                dep="=${dep}-${d}"
            fi

            if [[ "${b}" == "w" ]] ; then
                dep="!${dep}"
            else
                dep="!!${dep}"
            fi

            echo $cat >> metadata/categories.conf

            mkdir -p 'packages/'$cat'/target'
            cat <<END > packages/$cat/target/target-1.ebuild
EAPI="2"
DESCRIPTION="target"
KEYWORDS="test"
SLOT="0"
DEPEND="
    ${cat}/dep
    "
END

            mkdir -p 'packages/'$cat'/dep'
            cat <<END > packages/$cat/dep/dep-1.ebuild
EAPI="2"
DESCRIPTION="target"
KEYWORDS="test"
SLOT="0"
DEPEND="
    ${dep}
    "
END

        done
    done
done

cd ..