import opk, cfg, opkgcl opk.regress_init() o = opk.OpkGroup() o.add(Package="x", Version="1.0") o.write_opk() o.write_list() opkgcl.update() opkgcl.install("x") if not opkgcl.is_installed("x"): opk.fail("Package 'x' installed but reports as not installed.") opkgcl.flag_hold("x") # Make new versions of 'x' and 'z' available o.add(Package="x", Version="2.0") o.add(Package="z", Depends="x>=2.0") o.write_opk() o.write_list() opkgcl.update() opkgcl.install("z") if opkgcl.is_installed("z"): opk.fail("Package 'z' installed despite dependency on 'x>=2.0' with 'x' version 1.0 on hold.") if opkgcl.is_installed("x", "2.0"): opk.fail("Old version of package 'x' flagged as on hold but was upgraded.") if not opkgcl.is_installed("x", "1.0"):
# # Within the function `pkg_hash_fetch_best_installation_candidate`, we wish to # test the condition where `(held_pkg && good_pkg_by_name) == true`. So install # a 1.0, mark it as on hold and explicitly install 'a_2.0_all.opk'. This # installation should be blocked. # import os import opk, cfg, opkgcl opk.regress_init() a_10 = opk.Opk(Package="a", Version="1.0") a_10.write() a_20 = opk.Opk(Package="a", Version="2.0") a_20.write() opkgcl.install("a_1.0_all.opk") if not opkgcl.is_installed("a"): opk.fail("Package 'a' installed but reports as not installed.") opkgcl.flag_hold("a") # Try to explicitly install a version 2.0 opkgcl.install("a_2.0_all.opk") if opkgcl.is_installed("a", "2.0"): opk.xfail("Old version of package 'a' flagged as on hold but was upgraded.") if not opkgcl.is_installed("a", "1.0"): opk.fail("Package 'a' not upgraded but old version was removed.")
import opk, cfg, opkgcl opk.regress_init() o = opk.OpkGroup() o.add(Package="x", Version="1.0") o.write_opk() o.write_list() opkgcl.update() opkgcl.install("x") if not opkgcl.is_installed("x"): opk.fail("Package 'x' installed but reports as not installed.") opkgcl.flag_hold("x") # Make new versions of 'x' and 'z' available o.add(Package="x", Version="2.0") o.add(Package="z", Depends="x>=2.0") o.write_opk() o.write_list() opkgcl.update() opkgcl.install("z") if opkgcl.is_installed("z"): opk.fail( "Package 'z' installed despite dependency on 'x>=2.0' with 'x' version 1.0 on hold." ) if opkgcl.is_installed("x", "2.0"):