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
|
# coding=utf8
self.description = "Sync packages with evil filenames"
self.filesystem = ["usr/bin/endwithspace",
"usr/bin/newendwithspace",
"usr/bin/disappear",
"spaces/name",
"spaces/name2"]
p1 = pmpkg("spaces")
p1.files = ["usr/bin/endwithspace ",
"usr/bin/disappear ",
" spaces/name",
" spaces/gone"]
self.addpkg2db("local", p1)
sp1 = pmpkg("spaces", "1.1-1")
sp1.files = ["usr/bin/endwithspace ",
"usr/bin/newendwithspace ",
" spaces/name",
" spaces/name2"]
self.addpkg2db("sync", sp1)
names = ["Märchen", "ÆÆÆƺ", "пÑедÑпÑеждение", "סֶ×××±",
"ââ¯â»â", "ã¢ã
ã¨ã¾", "é误"]
p2 = pmpkg("unicodechars")
# somewhat derived from FS#9906
p2.files = ["usr/share/%s" % name for name in names]
self.addpkg2db("local", p2)
sp2 = pmpkg("unicodechars", "2.0-1")
sp2.files = ["usr/man/%s" % name for name in names]
self.addpkg2db("sync", sp2)
self.args = "-S %s %s" % (sp1.name, sp2.name)
self.addrule("PACMAN_RETCODE=0")
self.addrule("PKG_VERSION=%s|%s" % (sp1.name, sp1.version))
self.addrule("PKG_VERSION=%s|%s" % (sp2.name, sp2.version))
for f in self.filesystem:
self.addrule("FILE_EXIST=%s" % f)
self.addrule("FILE_EXIST=usr/bin/endwithspace ")
self.addrule("FILE_EXIST= spaces/name")
self.addrule("FILE_EXIST= spaces/name2")
self.addrule("!FILE_EXIST=usr/bin/disappear ")
for f in p2.files:
self.addrule("!FILE_EXIST=%s" % f)
for f in sp2.files:
self.addrule("FILE_EXIST=%s" % f)
|