summaryrefslogtreecommitdiffstats
path: root/tests/regress/issue79.py
diff options
context:
space:
mode:
authorpixdamix@gmail.com <pixdamix@gmail.com@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>2011-07-13 07:53:28 (EDT)
committer pixdamix@gmail.com <pixdamix@gmail.com@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>2011-07-13 07:53:28 (EDT)
commit989e9d3972939e7b8a3b3720d0bcffb1f559b468 (patch)
treeef317d62eb2c4f7eefe27805ba31540029ab6017 /tests/regress/issue79.py
parent3d697f6303f381a507f37f8d63129151d745dc6c (diff)
Fix issue-79: Opkg can remove a package even if another still depends on it.
- The problematic case is described by tests/regress/issue79.py Signed-off-by: Camille Moncelier <moncelier@devlife.org> git-svn-id: http://opkg.googlecode.com/svn/trunk@625 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
Diffstat (limited to 'tests/regress/issue79.py')
-rwxr-xr-xtests/regress/issue79.py33
1 files changed, 33 insertions, 0 deletions
diff --git a/tests/regress/issue79.py b/tests/regress/issue79.py
new file mode 100755
index 0000000..1d427f6
--- /dev/null
+++ b/tests/regress/issue79.py
@@ -0,0 +1,33 @@
+#!/usr/bin/python
+
+import os
+import opk, cfg, opkgcl
+
+opk.regress_init()
+
+o = opk.OpkGroup()
+o.add(Package="a", Version="1.0", Architecture="all", Depends="b", )
+o.add(Package="b", Version="1.0", Architecture="all")
+o.add(Package="c", Version="1.0", Architecture="all", Depends="b")
+o.write_opk()
+o.write_list()
+
+opkgcl.update()
+opkgcl.install("a")
+opkgcl.install("c")
+
+opkgcl.flag_unpacked("a")
+
+o = opk.OpkGroup()
+o.add(Package="a", Version="1.0", Architecture="all", Depends="b", )
+o.add(Package="b", Version="1.0", Architecture="all")
+o.add(Package="c", Version="2.0", Architecture="all")
+o.write_opk()
+o.write_list()
+
+opkgcl.update()
+opkgcl.upgrade("--autoremove")
+
+if not opkgcl.is_installed("b", "1.0"):
+ print("b has been removed even though a still depends on it")
+ exit(False)