aboutsummaryrefslogtreecommitdiff
path: root/python/repository_TEST_setup.sh
blob: 638fd825377fd7d0f6a781aadd6fe5dfec960953 (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
#!/bin/bash
# vim: set ft=sh sw=4 sts=4 et :

mkdir repository_TEST_dir || exit 1
cd repository_TEST_dir || exit 1

mkdir -p home/.paludis/repositories

cat <<END > home/.paludis/repositories/testrepo.conf
location = `pwd`/testrepo
format = ebuild
names_cache = /var/empty
cache = /var/empty
profiles = \${location}/profiles/testprofile
END

cat <<END > home/.paludis/repositories/installed.conf
location = `pwd`/installed
format = vdb
names_cache = /var/empty
provides_cache = /var/empty
END

cat <<END > home/.paludis/keywords.conf
*/* test
~foo/bar-1 ~test
END

cat <<END > home/.paludis/use.conf
*/* enabled
~foo/bar-1 sometimes_enabled
END

cat <<END > home/.paludis/licenses.conf
*/* *
END

mkdir -p testrepo/{eclass,licenses,distfiles,profiles/testprofile,foo/bar/files} || exit 1
cd testrepo || exit 1

echo "stray" > stray

echo "testrepo" > profiles/repo_name || exit 1
cat <<END > profiles/categories || exit 1
foo
foo1
foo2
foo3
foo4
END

cat <<END > profiles/profiles.desc || exit 1
x86 testprofile stable
END

cat <<END > profiles/package.mask || exit 1
foo1/bar
foo2/bar
END

cat <<END > profiles/testprofile/make.defaults || exit 1
ARCH=test
USERLAND=test
KERNEL=test
USE="test1 test2 -test5"
END

cat <<END > profiles/testprofile/package.mask || exit 1
foo1/bar
foo3/bar
END

cat <<END > profiles/testprofile/package.use || exit 1
foo/bar -test2 test3
END

cat <<END > profiles/testprofile/use.mask || exit 1
test4
END

cat <<END > profiles/testprofile/package.use.mask || exit 1
foo/bar -test4 test5
END

cat <<END > profiles/testprofile/use.force || exit 1
test6
END

cat <<END > profiles/testprofile/package.use.force || exit 1
foo/bar test7
END

cat <<END > profiles/use.desc || exit 1
test1 - A test use flag
END

cat <<END > profiles/use.local.desc || exit 1
foo/bar:test2 - A test local use flag
END

touch licenses/foo

for i in 1 2 3 4; do
    mkdir -p foo${i}/bar/

cat <<"END" > foo${i}/bar/bar-1.0.ebuild || exit 1
DESCRIPTION="Test package"
HOMEPAGE="http://paludis.pioto.org/"
SRC_URI=""
SLOT="0"
IUSE="test1"
LICENSE="GPL-2"
KEYWORDS="test"
END

done

touch foo/metadata.xml

cat <<"END" > foo/bar/bar-1.0.ebuild || exit 1
DESCRIPTION="Test package"
HOMEPAGE="http://paludis.pioto.org/"
SRC_URI=""
SLOT="0"
IUSE="test1"
LICENSE="GPL-2"
KEYWORDS="test"
END

cat <<"END" > foo/bar/bar-2.0.ebuild || exit 1
DESCRIPTION="Test package"
HOMEPAGE="http://paludis.pioto.org/"
SRC_URI=""
SLOT="0"
IUSE="test2"
LICENSE="GPL-2"
KEYWORDS="~test"
END
cd ..

mkdir -p installed/cat-one/pkg-one-1 || exit 1

for i in SLOT EAPI; do
    echo "0" >installed/cat-one/pkg-one-1/${i}
done

for i in DEPEND RDEPEND LICENSE INHERITED IUSE PDEPEND PROVIDE; do
    touch installed/cat-one/pkg-one-1/${i}
done

echo "flag1 flag2" >>installed/cat-one/pkg-one-1/USE

cat <<END >installed/cat-one/pkg-one-1/CONTENTS
dir //test
obj /test/test_file de54c26b0678df67aca147575523b3c2 1165250496
sym /test/test_link -> /test/test_file 1165250496
END