build: add cmake build system
[oweals/opkg-lede.git] / tests / regress / issue50.py
1 #!/usr/bin/python3
2
3 import os
4 import opk, cfg, opkgcl
5
6 opk.regress_init()
7
8 open("foo", "w").close()
9 a1 = opk.Opk(Package="a", Version="1.0", Architecture="all")
10 a1.write(data_files=["foo"])
11
12 opkgcl.install("a_1.0_all.opk")
13
14 o = opk.OpkGroup()
15 a2 = opk.Opk(Package="a", Version="2.0", Architecture="all", Depends="b")
16 a2.write()
17 b1 = opk.Opk(Package="b", Version="1.0", Architecture="all")
18 b1.write(data_files=["foo"])
19 o.opk_list.append(a2)
20 o.opk_list.append(b1)
21 o.write_list()
22
23 os.unlink("foo")
24
25 opkgcl.update()
26 opkgcl.upgrade()
27
28 if not opkgcl.is_installed("a", "2.0"):
29         print(__file__, ": Package 'a_2.0' not installed.")
30         exit(False)
31
32 foo_fullpath = "{}/foo".format(cfg.offline_root)
33
34 if not os.path.exists(foo_fullpath):
35         print(__file__, ": File 'foo' incorrectly orphaned.")
36         exit(False)
37
38 if not foo_fullpath in opkgcl.files("b"):
39         print(__file__, ": Package 'b' does not own file 'foo'.")
40         exit(False)
41
42 opkgcl.remove("a")
43 opkgcl.remove("b")