pkg: store size, installed size and installed time info in blob buffer
[oweals/opkg-lede.git] / tests / regress / issue26.py
1 #!/usr/bin/python3
2
3 import os
4 import opk, cfg, opkgcl
5
6 opk.regress_init()
7
8 o = opk.OpkGroup()
9 o.add(Package="a", Version="2.0", Architecture="all")
10 o.write_opk()
11 o.write_list()
12
13 # older version, not in Packages list
14 a1 = opk.Opk(Package="a", Version="1.0", Architecture="all")
15 a1.write()
16
17 opkgcl.update()
18
19 # install v2 from repository
20 opkgcl.install("a")
21 if not opkgcl.is_installed("a", "2.0"):
22         print(__file__, ": Package 'a_2.0' not installed.")
23         exit(False)
24
25 opkgcl.install("a_1.0_all.opk", "--force-downgrade")
26 if not opkgcl.is_installed("a", "1.0"):
27         print(__file__, ": Package 'a_1.0' not installed (1).")
28         exit(False)
29
30 opkgcl.install("a_1.0_all.opk", "--force-downgrade")
31 if not opkgcl.is_installed("a", "1.0"):
32         print(__file__, ": Package 'a_1.0' not installed (2).")
33         exit(False)
34
35 opkgcl.remove("a")