4 import opk
, cfg
, opkgcl
8 open("foo", "w").close()
9 a1
= opk
.Opk(Package
="a", Version
="1.0", Architecture
="all")
10 a1
.write(data_files
=["foo"])
11 os
.rename("a_1.0_all.opk", "a_with_foo.opk")
13 opkgcl
.install("a_with_foo.opk")
16 opkgcl
.install("a_with_foo.opk")
18 open("bar", "w").close()
20 a2
= opk
.Opk(Package
="a", Version
="1.0", Architecture
="all")
21 a2
.write(data_files
=["foo", "bar"])
29 opkgcl
.install("a", "--force-reinstall")
31 foo_fullpath
= "{}/foo".format(cfg
.offline_root
)
32 bar_fullpath
= "{}/bar".format(cfg
.offline_root
)
34 if not os
.path
.exists(foo_fullpath
) or not os
.path
.exists(bar_fullpath
):
35 print(__file__
, ": Files foo and/or bar are missing.")
38 a_files
= opkgcl
.files("a")
39 if not foo_fullpath
in a_files
or not bar_fullpath
in a_files
:
40 print(__file__
, ": Package 'a' does not own foo and/or bar.")
45 if os
.path
.exists(foo_fullpath
) or os
.path
.exists(bar_fullpath
):
46 print(__file__
, ": Files foo and/or bar still exist "
47 "after removal of package 'a'.")
52 a2
= opk
.Opk(Package
="a", Version
="1.0", Architecture
="all")
60 opkgcl
.install("a", "--force-reinstall")
62 if os
.path
.exists(foo_fullpath
):
63 print(__file__
, ": File 'foo' not orphaned as it should be.")
66 if foo_fullpath
in opkgcl
.files("a"):
67 print(__file__
, ": Package 'a' incorrectly owns file 'foo'.")