o.opk_list.append(a2) o.write_list() os.unlink("foo") os.unlink("bar") opkgcl.update() opkgcl.install("a", "--force-reinstall") foo_fullpath = "{}/foo".format(cfg.offline_root) bar_fullpath = "{}/bar".format(cfg.offline_root) if not os.path.exists(foo_fullpath) or not os.path.exists(bar_fullpath): opk.fail("Files foo and/or bar are missing.") a_files = opkgcl.files("a") if not foo_fullpath in a_files or not bar_fullpath in a_files: opk.fail("Package 'a' does not own foo and/or bar.") opkgcl.remove("a") if os.path.exists(foo_fullpath) or os.path.exists(bar_fullpath): opk.fail("Files foo and/or bar still exist " "after removal of package 'a'.") # ---- o = opk.OpkGroup() a2 = opk.Opk(Package="a") a2.write() o.opk_list.append(a2) o.write_list()
import os import opk, cfg, opkgcl opk.regress_init() open("asdf", "w").close() a = opk.Opk(Package="a", Version="1.0", Architecture="all") a.write(data_files=["asdf"]) b = opk.Opk(Package="b", Version="1.0", Architecture="all") b.write(data_files=["asdf"]) os.unlink("asdf") opkgcl.install("a_1.0_all.opk") if not opkgcl.is_installed("a"): opk.fail("Package 'a' not installed.") if not os.path.exists("{}/asdf".format(cfg.offline_root)): opk.fail("asdf not created.") opkgcl.install("b_1.0_all.opk", "--force-overwrite") if "{}/asdf".format(cfg.offline_root) not in opkgcl.files("b"): opk.fail("asdf not claimed by ``b''.") if "{}/asdf".format(cfg.offline_root) in opkgcl.files("a"): opk.fail("asdf is still claimed by ``a''.") opkgcl.remove("b") opkgcl.remove("a")
os.unlink("foo") opkgcl.update() status = opkgcl.upgrade("a") if status != 0: opk.fail("Upgrade operation failed (Return value was different than 0)") if not opkgcl.is_installed("a", "2.0"): opk.fail("Package 'a_2.0' not installed.") foo_fullpath = "{}/foo".format(cfg.offline_root) if not os.path.exists(foo_fullpath): opk.fail("File 'foo' incorrectly orphaned.") if not foo_fullpath in opkgcl.files("b"): opk.fail("Package 'b' does not own file 'foo'.") foo1_fullpath = "{}/foo1".format(cfg.offline_root) if not os.path.exists(foo1_fullpath): opk.fail("File 'foo1' incorrectly orphaned.") if not foo1_fullpath in opkgcl.files("c"): opk.fail("Package 'c' does not own file 'foo'.") opkgcl.remove("a") opkgcl.remove("b") opkgcl.remove("c")
opk.regress_init() open("asdf", "w").close() a = opk.Opk(Package="a", Version="1.0", Architecture="all") a.write(data_files=["asdf"]) b = opk.Opk(Package="b", Version="1.0", Architecture="all") b.write(data_files=["asdf"]) os.unlink("asdf") opkgcl.install("a_1.0_all.opk") if not opkgcl.is_installed("a"): print(__file__, ": Package 'a' not installed.") exit(False) if not os.path.exists("{}/asdf".format(cfg.offline_root)): print(__file__, ": asdf not created.") exit(False) opkgcl.install("b_1.0_all.opk", "--force-overwrite") if "{}/asdf".format(cfg.offline_root) not in opkgcl.files("b"): print(__file__, ": asdf not claimed by ``b''.") exit(False) if "{}/asdf".format(cfg.offline_root) in opkgcl.files("a"): print(__file__, ": asdf is still claimed by ``a''.") exit(False) opkgcl.remove("b") opkgcl.remove("a")
open(x1, "w").close() open(x2, "w").close() a = opk.Opk(Package="a") a.write(data_files=[x1, x2]) os.unlink(x1) os.unlink(x2) opkgcl.install("a_1.0_all.opk") if not opkgcl.is_installed("a"): opk.fail("Package 'a' not installed.") open(x2, "w").close() open(x3, "w").close() a = opk.Opk(Package="b", Replaces="a", Provides="a", Conflicts="a") a.write(data_files=[x2, x3]) os.unlink(x2) os.unlink(x3) opkgcl.install("b_1.0_all.opk") if not opkgcl.is_installed("b"): opk.fail("Package 'b' not installed.") if opkgcl.is_installed("a"): opk.fail("Package 'a' was not replaced.") x2fullpath = "{}/x2".format(cfg.offline_root) if not x2fullpath in opkgcl.files("b"): opk.xfail("[libsolv] Package 'b' does not own file 'x2'.") opkgcl.remove("b")
o.write_list() os.unlink("foo") os.unlink("bar") opkgcl.update() opkgcl.install("a", "--force-reinstall") foo_fullpath = "{}/foo".format(cfg.offline_root) bar_fullpath = "{}/bar".format(cfg.offline_root) if not os.path.exists(foo_fullpath) or not os.path.exists(bar_fullpath): print(__file__, ": Files foo and/or bar are missing.") exit(False) a_files = opkgcl.files("a") if not foo_fullpath in a_files or not bar_fullpath in a_files: print(__file__, ": Package 'a' does not own foo and/or bar.") exit(False) opkgcl.remove("a") if os.path.exists(foo_fullpath) or os.path.exists(bar_fullpath): print( __file__, ": Files foo and/or bar still exist " "after removal of package 'a'.") exit(False) # ---- o = opk.OpkGroup() a2 = opk.Opk(Package="a", Version="1.0", Architecture="all")
open(x1, "w").close() open(x2, "w").close() a = opk.Opk(Package="a") a.write(data_files=[x1, x2]) os.unlink(x1) os.unlink(x2) opkgcl.install("a_1.0_all.opk") if not opkgcl.is_installed("a"): opk.fail("Package 'a' not installed.") open(x2, "w").close() open(x3, "w").close() a = opk.Opk(Package="b", Replaces="a", Provides="a", Conflicts="a") a.write(data_files=[x2, x3]) os.unlink(x2) os.unlink(x3) opkgcl.install("b_1.0_all.opk") if not opkgcl.is_installed("b"): opk.fail("Package 'b' not installed.") if opkgcl.is_installed("a"): opk.fail("Package 'a' was not replaced.") x2fullpath = "{}/x2".format(cfg.offline_root) if not x2fullpath in opkgcl.files("b"): opk.xfail("Package 'b' does not own file 'x2'.") opkgcl.remove("b")
o = opk.OpkGroup() a2 = opk.Opk(Package="a", Version="2.0", Depends="b") a2.write() b1 = opk.Opk(Package="b", Version="1.0") b1.write(data_files=["foo"]) o.opk_list.append(a2) o.opk_list.append(b1) o.write_list() os.unlink("foo") opkgcl.update() opkgcl.upgrade() if not opkgcl.is_installed("a", "2.0"): print(__file__, ": Package 'a_2.0' not installed.") exit(False) foo_fullpath = "{}/foo".format(cfg.offline_root) if not os.path.exists(foo_fullpath): print(__file__, ": File 'foo' incorrectly orphaned.") exit(False) if not foo_fullpath in opkgcl.files("b"): print(__file__, ": Package 'b' does not own file 'foo'.") exit(False) opkgcl.remove("a") opkgcl.remove("b")