issue26.py 809 B

1234567891011121314151617181920212223242526272829303132333435
  1. #!/usr/bin/python3
  2. import os
  3. import opk, cfg, opkgcl
  4. opk.regress_init()
  5. o = opk.OpkGroup()
  6. o.add(Package="a", Version="2.0", Architecture="all")
  7. o.write_opk()
  8. o.write_list()
  9. # older version, not in Packages list
  10. a1 = opk.Opk(Package="a", Version="1.0", Architecture="all")
  11. a1.write()
  12. opkgcl.update()
  13. # install v2 from repository
  14. opkgcl.install("a")
  15. if not opkgcl.is_installed("a", "2.0"):
  16. print(__file__, ": Package 'a_2.0' not installed.")
  17. exit(False)
  18. opkgcl.install("a_1.0_all.opk", "--force-downgrade")
  19. if not opkgcl.is_installed("a", "1.0"):
  20. print(__file__, ": Package 'a_1.0' not installed (1).")
  21. exit(False)
  22. opkgcl.install("a_1.0_all.opk", "--force-downgrade")
  23. if not opkgcl.is_installed("a", "1.0"):
  24. print(__file__, ": Package 'a_1.0' not installed (2).")
  25. exit(False)
  26. opkgcl.remove("a")