summaryrefslogtreecommitdiffstats
path: root/src/tests/regress/.svn/text-base
diff options
context:
space:
mode:
authorP. J. McDermott <pjm@nac.net>2013-06-02 10:12:27 (EDT)
committer P. J. McDermott <pjm@nac.net>2013-06-02 10:12:27 (EDT)
commit12f19801bf46ecceda69e476119a787e405ff904 (patch)
tree1101558927e34a0d6082e79bef8e400e9cc94b99 /src/tests/regress/.svn/text-base
parent5b483e83bc811d42c9eb0a0e38b45d4549df31bd (diff)
Delete upstream source directory.
Diffstat (limited to 'src/tests/regress/.svn/text-base')
-rw-r--r--src/tests/regress/.svn/text-base/Makefile.svn-base15
-rw-r--r--src/tests/regress/.svn/text-base/cfg.py.svn-base5
-rw-r--r--src/tests/regress/.svn/text-base/filehash.py.svn-base35
-rw-r--r--src/tests/regress/.svn/text-base/issue26.py.svn-base35
-rw-r--r--src/tests/regress/.svn/text-base/issue31.py.svn-base25
-rw-r--r--src/tests/regress/.svn/text-base/issue45.py.svn-base33
-rw-r--r--src/tests/regress/.svn/text-base/issue46.py.svn-base39
-rw-r--r--src/tests/regress/.svn/text-base/issue50.py.svn-base43
-rw-r--r--src/tests/regress/.svn/text-base/issue51.py.svn-base70
-rw-r--r--src/tests/regress/.svn/text-base/issue55.py.svn-base25
-rw-r--r--src/tests/regress/.svn/text-base/issue58.py.svn-base31
-rw-r--r--src/tests/regress/.svn/text-base/issue72.py.svn-base52
-rw-r--r--src/tests/regress/.svn/text-base/issue79.py.svn-base33
-rw-r--r--src/tests/regress/.svn/text-base/issue84.py.svn-base45
-rw-r--r--src/tests/regress/.svn/text-base/issue85.py.svn-base29
-rw-r--r--src/tests/regress/.svn/text-base/opk.py.svn-base111
-rw-r--r--src/tests/regress/.svn/text-base/opkgcl.py.svn-base64
-rw-r--r--src/tests/regress/.svn/text-base/update_loses_autoinstalled_flag.py.svn-base63
18 files changed, 0 insertions, 753 deletions
diff --git a/src/tests/regress/.svn/text-base/Makefile.svn-base b/src/tests/regress/.svn/text-base/Makefile.svn-base
deleted file mode 100644
index 0accb31..0000000
--- a/src/tests/regress/.svn/text-base/Makefile.svn-base
+++ /dev/null
@@ -1,15 +0,0 @@
-PYTHON=/usr/bin/python3
-REGRESSION_TESTS=issue26.py issue31.py issue45.py issue46.py \
- issue50.py issue51.py issue55.py issue58.py \
- issue72.py issue79.py issue84.py issue85.py \
- filehash.py \
- update_loses_autoinstalled_flag.py
-
-regress:
- @for test in $(REGRESSION_TESTS); do \
- echo $$test; \
- $(PYTHON) $$test; \
- done
-
-clean:
- rm -f *.pyc
diff --git a/src/tests/regress/.svn/text-base/cfg.py.svn-base b/src/tests/regress/.svn/text-base/cfg.py.svn-base
deleted file mode 100644
index 6f78996..0000000
--- a/src/tests/regress/.svn/text-base/cfg.py.svn-base
+++ /dev/null
@@ -1,5 +0,0 @@
-import os
-
-opkdir = "/tmp/opk"
-offline_root = "/tmp/opkg"
-opkgcl = os.path.realpath("../../src/opkg-cl")
diff --git a/src/tests/regress/.svn/text-base/filehash.py.svn-base b/src/tests/regress/.svn/text-base/filehash.py.svn-base
deleted file mode 100644
index e6cbe62..0000000
--- a/src/tests/regress/.svn/text-base/filehash.py.svn-base
+++ /dev/null
@@ -1,35 +0,0 @@
-#!/usr/bin/python3
-
-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"):
- 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")
diff --git a/src/tests/regress/.svn/text-base/issue26.py.svn-base b/src/tests/regress/.svn/text-base/issue26.py.svn-base
deleted file mode 100644
index dd4ef92..0000000
--- a/src/tests/regress/.svn/text-base/issue26.py.svn-base
+++ /dev/null
@@ -1,35 +0,0 @@
-#!/usr/bin/python3
-
-import os
-import opk, cfg, opkgcl
-
-opk.regress_init()
-
-o = opk.OpkGroup()
-o.add(Package="a", Version="2.0")
-o.write_opk()
-o.write_list()
-
-# older version, not in Packages list
-a1 = opk.Opk(Package="a", Version="1.0")
-a1.write()
-
-opkgcl.update()
-
-# install v2 from repository
-opkgcl.install("a")
-if not opkgcl.is_installed("a", "2.0"):
- print(__file__, ": Package 'a_2.0' not installed.")
- exit(False)
-
-opkgcl.install("a_1.0_all.opk", "--force-downgrade")
-if not opkgcl.is_installed("a", "1.0"):
- print(__file__, ": Package 'a_1.0' not installed (1).")
- exit(False)
-
-opkgcl.install("a_1.0_all.opk", "--force-downgrade")
-if not opkgcl.is_installed("a", "1.0"):
- print(__file__, ": Package 'a_1.0' not installed (2).")
- exit(False)
-
-opkgcl.remove("a")
diff --git a/src/tests/regress/.svn/text-base/issue31.py.svn-base b/src/tests/regress/.svn/text-base/issue31.py.svn-base
deleted file mode 100644
index 42e51e3..0000000
--- a/src/tests/regress/.svn/text-base/issue31.py.svn-base
+++ /dev/null
@@ -1,25 +0,0 @@
-#!/usr/bin/python3
-
-import os
-import opk, cfg, opkgcl
-
-opk.regress_init()
-
-o = opk.OpkGroup()
-o.add(Package="a", Depends="b")
-o.add(Package="b", Depends="c")
-o.write_opk()
-o.write_list()
-
-opkgcl.update()
-
-opkgcl.install("a")
-if opkgcl.is_installed("a"):
- print(__file__, ": Package 'a' installed, despite dependency "
- "upon a package with an unresolved dependency.")
- exit(False)
-
-if opkgcl.is_installed("b"):
- print(__file__, ": Package 'b' installed, "
- "despite unresolved dependency.")
- exit(False)
diff --git a/src/tests/regress/.svn/text-base/issue45.py.svn-base b/src/tests/regress/.svn/text-base/issue45.py.svn-base
deleted file mode 100644
index 30735f9..0000000
--- a/src/tests/regress/.svn/text-base/issue45.py.svn-base
+++ /dev/null
@@ -1,33 +0,0 @@
-#!/usr/bin/python3
-
-import os
-import opk, cfg, opkgcl
-
-opk.regress_init()
-
-o = opk.OpkGroup()
-o.add(Package="a", Depends="b")
-o.add(Package="b")
-o.write_opk()
-o.write_list()
-
-opkgcl.update()
-
-(status, output) = opkgcl.opkgcl("install --force-postinstall a")
-ln_a = output.find("Configuring a")
-ln_b = output.find("Configuring b")
-
-if ln_a == -1:
- print(__file__, ": Didn't see package 'a' get configured.")
- exit(False)
-
-if ln_b == -1:
- print(__file__, ": Didn't see package 'b' get configured.")
- exit(False)
-
-if ln_a < ln_b:
- print(__file__, ": Packages 'a' and 'b' configured in wrong order.")
- exit(False)
-
-opkgcl.remove("a")
-opkgcl.remove("b")
diff --git a/src/tests/regress/.svn/text-base/issue46.py.svn-base b/src/tests/regress/.svn/text-base/issue46.py.svn-base
deleted file mode 100644
index ec56941..0000000
--- a/src/tests/regress/.svn/text-base/issue46.py.svn-base
+++ /dev/null
@@ -1,39 +0,0 @@
-#!/usr/bin/python3
-
-import os
-import opk, cfg, opkgcl
-
-opk.regress_init()
-
-o = opk.OpkGroup()
-o.add(Package="a", Version="1.0", Recommends="b")
-o.add(Package="b", Version="2.0")
-o.write_opk()
-o.write_list()
-
-# prime the status file so 'b' is not installed as a recommendation
-status_filename = "{}/usr/lib/opkg/status".format(cfg.offline_root)
-f = open(status_filename, "w")
-f.write("Package: b\n")
-f.write("Version: 1.0\n")
-f.write("Architecture: all\n")
-f.write("Status: deinstall hold not-installed\n")
-f.close()
-
-opkgcl.update()
-
-opkgcl.install("a")
-if opkgcl.is_installed("b"):
- print(__file__, ": Package 'b' installed despite "
- "deinstall/hold status.")
- exit(False)
-
-opkgcl.remove("a")
-opkgcl.install("a")
-if opkgcl.is_installed("b"):
- print(__file__, ": Package 'b' installed - deinstall/hold status "
- "not retained.")
- exit(False)
-
-opkgcl.remove("a")
-open(status_filename, "w").close()
diff --git a/src/tests/regress/.svn/text-base/issue50.py.svn-base b/src/tests/regress/.svn/text-base/issue50.py.svn-base
deleted file mode 100644
index 19897b4..0000000
--- a/src/tests/regress/.svn/text-base/issue50.py.svn-base
+++ /dev/null
@@ -1,43 +0,0 @@
-#!/usr/bin/python3
-
-import os
-import opk, cfg, opkgcl
-
-opk.regress_init()
-
-open("foo", "w").close()
-a1 = opk.Opk(Package="a", Version="1.0")
-a1.write(data_files=["foo"])
-
-opkgcl.install("a_1.0_all.opk")
-
-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")
diff --git a/src/tests/regress/.svn/text-base/issue51.py.svn-base b/src/tests/regress/.svn/text-base/issue51.py.svn-base
deleted file mode 100644
index 9849dbc..0000000
--- a/src/tests/regress/.svn/text-base/issue51.py.svn-base
+++ /dev/null
@@ -1,70 +0,0 @@
-#!/usr/bin/python3
-
-import os
-import opk, cfg, opkgcl
-
-opk.regress_init()
-
-open("foo", "w").close()
-a1 = opk.Opk(Package="a")
-a1.write(data_files=["foo"])
-os.rename("a_1.0_all.opk", "a_with_foo.opk")
-
-opkgcl.install("a_with_foo.opk")
-
-# ----
-opkgcl.install("a_with_foo.opk")
-
-open("bar", "w").close()
-o = opk.OpkGroup()
-a2 = opk.Opk(Package="a")
-a2.write(data_files=["foo", "bar"])
-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):
- 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")
-a2.write()
-o.opk_list.append(a2)
-o.write_list()
-
-
-opkgcl.update()
-
-opkgcl.install("a", "--force-reinstall")
-
-if os.path.exists(foo_fullpath):
- print(__file__, ": File 'foo' not orphaned as it should be.")
- exit(False)
-
-if foo_fullpath in opkgcl.files("a"):
- print(__file__, ": Package 'a' incorrectly owns file 'foo'.")
- exit(False)
-
-opkgcl.remove("a")
diff --git a/src/tests/regress/.svn/text-base/issue55.py.svn-base b/src/tests/regress/.svn/text-base/issue55.py.svn-base
deleted file mode 100644
index 8628306..0000000
--- a/src/tests/regress/.svn/text-base/issue55.py.svn-base
+++ /dev/null
@@ -1,25 +0,0 @@
-#!/usr/bin/python3
-
-import os
-import opk, cfg, opkgcl
-
-opk.regress_init()
-
-long_filename = 110*"a"
-
-os.symlink(long_filename, "linky")
-a = opk.Opk(Package="a")
-a.write(data_files=["linky"])
-os.unlink("linky")
-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.lexists("{}/linky".format(cfg.offline_root)):
- print(__file__, ": symlink to file with a name longer than 100 "
- "characters not created.")
- exit(False)
-
-opkgcl.remove("a")
diff --git a/src/tests/regress/.svn/text-base/issue58.py.svn-base b/src/tests/regress/.svn/text-base/issue58.py.svn-base
deleted file mode 100644
index 72a1854..0000000
--- a/src/tests/regress/.svn/text-base/issue58.py.svn-base
+++ /dev/null
@@ -1,31 +0,0 @@
-#!/usr/bin/python3
-
-import os
-import opk, cfg, opkgcl
-
-opk.regress_init()
-
-o = opk.OpkGroup()
-o.add(Package="a", Recommends="b")
-o.add(Package="b")
-o.add(Package="c", Recommends="b")
-o.write_opk()
-o.write_list()
-
-opkgcl.update()
-
-opkgcl.install("a")
-opkgcl.install("c")
-
-opkgcl.remove("a", "--autoremove")
-if not opkgcl.is_installed("b"):
- print(__file__, ": Pacakge 'b' orphaned despite remaining "
- "recommending package 'c'.")
- exit(False)
-
-opkgcl.remove("c", "--autoremove")
-if opkgcl.is_installed("b"):
- print(__file__, ": Recommended package 'b' not autoremoved.")
- exit(False)
-
-
diff --git a/src/tests/regress/.svn/text-base/issue72.py.svn-base b/src/tests/regress/.svn/text-base/issue72.py.svn-base
deleted file mode 100644
index d0c511b..0000000
--- a/src/tests/regress/.svn/text-base/issue72.py.svn-base
+++ /dev/null
@@ -1,52 +0,0 @@
-#!/usr/bin/python3
-
-import os
-import opk, cfg, opkgcl
-
-opk.regress_init()
-
-long_dir = 110*"a"
-long_b = 110*"b"
-long_filename = long_dir + "/"+ long_b
-long_filename2 = long_dir + "/" + 110*"c"
-
-os.mkdir(long_dir)
-open(long_filename, "w").close()
-os.symlink(long_b, long_filename2)
-a = opk.Opk(Package="a")
-a.write(data_files=[long_dir, long_filename, long_filename2])
-os.unlink(long_filename)
-os.unlink(long_filename2)
-os.rmdir(long_dir)
-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("{}/{}".format(cfg.offline_root, long_dir)):
- print(__file__, ": dir with name longer than 100 "
- "characters not created.")
- exit(False)
-
-if not os.path.exists("{}/{}".format(cfg.offline_root, long_filename)):
- print(__file__, ": file with a name longer than 100 characters, "
- "in dir with name longer than 100 characters, "
- "not created.")
- exit(False)
-
-if not os.path.lexists("{}/{}".format(cfg.offline_root, long_filename2)):
- print(__file__, ": symlink with a name longer than 100 characters, "
- "pointing at a file with a name longer than "
- "100 characters,"
- "in dir with name longer than 100 characters, "
- "not created.")
- exit(False)
-
-linky = os.path.realpath("{}/{}".format(cfg.offline_root, long_filename2))
-linky_dst = "{}/{}".format(cfg.offline_root, long_filename)
-if linky != linky_dst:
- print(__file__, ": symlink path truncated.")
- exit(False)
-
-opkgcl.remove("a")
diff --git a/src/tests/regress/.svn/text-base/issue79.py.svn-base b/src/tests/regress/.svn/text-base/issue79.py.svn-base
deleted file mode 100644
index 30ba201..0000000
--- a/src/tests/regress/.svn/text-base/issue79.py.svn-base
+++ /dev/null
@@ -1,33 +0,0 @@
-#!/usr/bin/python
-
-import os
-import opk, cfg, opkgcl
-
-opk.regress_init()
-
-o = opk.OpkGroup()
-o.add(Package="a", Version="1.0", Depends="b")
-o.add(Package="b", Version="1.0")
-o.add(Package="c", Version="1.0", 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", Depends="b")
-o.add(Package="b", Version="1.0")
-o.add(Package="c", Version="2.0")
-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)
diff --git a/src/tests/regress/.svn/text-base/issue84.py.svn-base b/src/tests/regress/.svn/text-base/issue84.py.svn-base
deleted file mode 100644
index 1f5d43e..0000000
--- a/src/tests/regress/.svn/text-base/issue84.py.svn-base
+++ /dev/null
@@ -1,45 +0,0 @@
-#!/usr/bin/python3
-
-import opk, cfg, opkgcl
-
-def cleanup():
- opkgcl.remove("a1")
- opkgcl.remove("b1")
- opkgcl.remove("a")
- opkgcl.remove("b")
- opkgcl.remove('c')
-
-opk.regress_init()
-
-o = opk.OpkGroup()
-o.add(Package="a", Provides="v", Depends="a1")
-o.add(Package="b", Provides="v", Depends="b1")
-o.add(Package="c", Depends="v")
-o.add(Package="a1")
-o.add(Package="b1")
-
-o.write_opk()
-o.write_list()
-
-opkgcl.update()
-
-# install ``a1`` directly
-opkgcl.install("a1_1.0_all.opk")
-if not opkgcl.is_installed("a1"):
- print(__file__, ": package ``a1'' not installed.")
- cleanup()
- exit(False)
-
-# install ``c'' from repository
-opkgcl.install("c")
-if not opkgcl.is_installed("c"):
- print(__file__, ": package ``c'' not installed.")
- cleanup()
- exit(False)
-
-if opkgcl.is_installed("b1"):
- print(__file__, ": package ``b1'' is installed, but should not be.")
- cleanup()
- exit(False)
-
-cleanup()
diff --git a/src/tests/regress/.svn/text-base/issue85.py.svn-base b/src/tests/regress/.svn/text-base/issue85.py.svn-base
deleted file mode 100644
index 3250075..0000000
--- a/src/tests/regress/.svn/text-base/issue85.py.svn-base
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/usr/bin/python3
-
-import opk, cfg, opkgcl
-
-def cleanup():
- opkgcl.remove("a")
- opkgcl.remove("b")
- opkgcl.remove('c')
-
-opk.regress_init()
-
-o = opk.OpkGroup()
-o.add(Package="a", Provides="v")
-o.add(Package="b", Provides="v", Depends="b_nonexistant")
-o.add(Package="c", Depends="v")
-
-o.write_opk()
-o.write_list()
-
-opkgcl.update()
-
-# install ``c'' from repository
-opkgcl.install("c")
-if not opkgcl.is_installed("c"):
- print(__file__, ": package ``c'' not installed.")
- cleanup()
- exit(False)
-
-cleanup()
diff --git a/src/tests/regress/.svn/text-base/opk.py.svn-base b/src/tests/regress/.svn/text-base/opk.py.svn-base
deleted file mode 100644
index f96037e..0000000
--- a/src/tests/regress/.svn/text-base/opk.py.svn-base
+++ /dev/null
@@ -1,111 +0,0 @@
-import tarfile, os
-import cfg
-
-class Opk:
- valid_control_fields = ["Package", "Version", "Depends", "Provides",\
- "Replaces", "Conflicts", "Suggests", "Recommends",\
- "Section", "Architecture", "Maintainer", "MD5Sum",\
- "Size", "InstalledSize", "Filename", "Source",\
- "Description", "OE", "Homepage", "Priority",\
- "Conffiles"]
-
- def __init__(self, **control):
- for k in control.keys():
- if k not in self.valid_control_fields:
- raise Exception("Invalid control field: "
- "{}".format(k))
- if "Package" not in control.keys():
- print("Cannot create opk without Package name.\n")
- return None
- if "Architecture" not in control.keys():
- control["Architecture"] = "all"
- if "Version" not in control.keys():
- control["Version"] = "1.0"
- self.control = control
-
- def write(self, tar_not_ar=False, data_files=None):
- filename = "{Package}_{Version}_{Architecture}.opk"\
- .format(**self.control)
- if os.path.exists(filename):
- os.unlink(filename)
- if os.path.exists("control"):
- os.unlink("control")
- if os.path.exists("control.tar.gz"):
- os.unlink("control.tar.gz")
- if os.path.exists("data.tar.gz"):
- os.unlink("data.tar.gz")
-
- f = open("control", "w")
- for k in self.control.keys():
- f.write("{}: {}\n".format(k, self.control[k]))
- f.close()
-
- tar = tarfile.open("control.tar.gz", "w:gz")
- tar.add("control")
- tar.close()
-
- tar = tarfile.open("data.tar.gz", "w:gz")
- if data_files:
- for df in data_files:
- tar.add(df)
- tar.close()
-
-
- if tar_not_ar:
- tar = tarfile.open(filename, "w:gz")
- tar.add("control.tar.gz")
- tar.add("data.tar.gz")
- tar.close()
- else:
- os.system("ar q {} control.tar.gz data.tar.gz \
- 2>/dev/null".format(filename))
-
- os.unlink("control")
- os.unlink("control.tar.gz")
- os.unlink("data.tar.gz")
-
-class OpkGroup:
- def __init__(self):
- self.opk_list = []
-
- def add(self, **control):
- self.opk_list.append(Opk(**control))
-
- def addOpk(self, opk):
- self.opk_list.append(opk)
-
- def write_opk(self, tar_not_ar=False):
- for o in self.opk_list:
- o.write(tar_not_ar)
-
- def write_list(self, filename="Packages"):
- f = open(filename, "w")
- for opk in self.opk_list:
- for k in opk.control.keys():
- f.write("{}: {}\n".format(k, opk.control[k]))
- f.write("Filename: {Package}_{Version}_{Architecture}"
- ".opk\n".format(**opk.control))
- f.write("\n")
- f.close()
-
-
-def regress_init():
- """
- Initialisation and sanity checking.
- """
-
- if not os.access(cfg.opkgcl, os.X_OK):
- print("Cannot exec {}".format(cfg.opkgcl))
- exit(False)
-
- os.chdir(cfg.opkdir)
-
- os.system("rm -fr {}".format(cfg.offline_root))
-
- os.makedirs("{}/usr/lib/opkg".format(cfg.offline_root))
- os.makedirs("{}/etc/opkg".format(cfg.offline_root))
-
- f = open("{}/etc/opkg/opkg.conf".format(cfg.offline_root), "w")
- f.write("arch all 1\n")
- f.write("src test file:{}\n".format(cfg.opkdir))
- f.close()
diff --git a/src/tests/regress/.svn/text-base/opkgcl.py.svn-base b/src/tests/regress/.svn/text-base/opkgcl.py.svn-base
deleted file mode 100644
index 47e7dd3..0000000
--- a/src/tests/regress/.svn/text-base/opkgcl.py.svn-base
+++ /dev/null
@@ -1,64 +0,0 @@
-#!/usr/bin/python3
-
-import os, subprocess
-import cfg
-
-def opkgcl(opkg_args):
- cmd = "{} -o {} {}".format(cfg.opkgcl, cfg.offline_root, opkg_args)
- #print(cmd)
- return subprocess.getstatusoutput(cmd)
-
-def install(pkg_name, flags=""):
- return opkgcl("{} install {}".format(flags, pkg_name))[0]
-
-def remove(pkg_name, flags=""):
- return opkgcl("{} remove {}".format(flags, pkg_name))[0]
-
-def update():
- return opkgcl("update")[0]
-
-def upgrade(params=None):
- if params:
- opkgcl("upgrade {}".format(params))[0]
- else:
- return opkgcl("upgrade")[0]
-
-def files(pkg_name):
- output = opkgcl("files {}".format(pkg_name))[1]
- return output.split("\n")[1:]
-
-
-def flag_unpacked(pkg_name):
- out = opkgcl("flag unpacked {}".format(pkg_name))
- return out == "Setting flags for package {} to unpacked.".format(pkg_name)
-
-def is_installed(pkg_name, version=None):
- out = opkgcl("list_installed {}".format(pkg_name))[1]
- if len(out) == 0 or out.split()[0] != pkg_name:
- return False
- if version and out.split()[2] != version:
- return False
- if not os.path.exists("{}/usr/lib/opkg/info/{}.control"\
- .format(cfg.offline_root, pkg_name)):
- return False
- return True
-
-def is_autoinstalled(pkg_name):
- status_path = "{}/usr/lib/opkg/status".format(cfg.offline_root)
- if not os.path.exists(status_path):
- return False
- status_file = open(status_path, "r")
- status = status_file.read()
- status_file.close()
- index_start = status.find("Package: {}".format(pkg_name))
- if index_start < 0:
- return False
- index_end = status.find("\n\n", index_start)
- return status.find("Auto-Installed: yes", index_start, index_end) >= 0
-
-
-if __name__ == '__main__':
- import sys
- (status, output) = opkgcl(" ".join(sys.argv[1:]))
- print(output)
- exit(status)
diff --git a/src/tests/regress/.svn/text-base/update_loses_autoinstalled_flag.py.svn-base b/src/tests/regress/.svn/text-base/update_loses_autoinstalled_flag.py.svn-base
deleted file mode 100644
index 5ae030c..0000000
--- a/src/tests/regress/.svn/text-base/update_loses_autoinstalled_flag.py.svn-base
+++ /dev/null
@@ -1,63 +0,0 @@
-#!/usr/bin/python3
-
-import os
-import opk, cfg, opkgcl
-
-bug = True
-
-opk.regress_init()
-
-open("asdf", "w").close()
-a = opk.Opk(Package="a", Version="1.0", Depends="b")
-a.write()
-b = opk.Opk(Package="b", Version="1.0")
-b.write(data_files=["asdf"])
-
-o = opk.OpkGroup()
-o.addOpk(a)
-o.addOpk(b)
-o.write_list()
-
-opkgcl.update()
-opkgcl.install("a")
-
-if not opkgcl.is_autoinstalled("b"):
- print("b is not autoinstalled")
- exit(False)
-
-if (bug):
- a = opk.Opk(Package="a", Version="2.0", Depends="b")
- a.write()
- b = opk.Opk(Package="b", Version="2.0")
- b.write(data_files=["asdf"])
-
- o = opk.OpkGroup()
- o.addOpk(a)
- o.addOpk(b)
- o.write_list()
-
- opkgcl.update()
- opkgcl.upgrade();
-
- if not opkgcl.is_autoinstalled("b"):
- print("b is not autoinstalled anymore")
- exit(False)
-
-a = opk.Opk(Package="a", Version="3.0")
-a.write(data_files=["asdf"])
-os.unlink("asdf")
-
-o = opk.OpkGroup()
-o.addOpk(a)
-o.write_list()
-
-opkgcl.update()
-opkgcl.upgrade();
-
-if opkgcl.is_installed("b", "2.0"):
- print("b is still installed")
- exit(False)
-
-if not opkgcl.is_installed("a", "3.0"):
- print("a is not installed")
- exit(False)