From 1d9fe6093125be143fde351305214051afc5ec3b Mon Sep 17 00:00:00 2001 From: pixdamix@gmail.com Date: Thu, 19 Jan 2012 08:51:59 -0500 Subject: testcase displaying the loss of the auto-installed flag git-svn-id: http://opkg.googlecode.com/svn/trunk@634 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358 --- (limited to 'tests/regress/opkgcl.py') diff --git a/tests/regress/opkgcl.py b/tests/regress/opkgcl.py index bdd9e1e..47e7dd3 100755 --- a/tests/regress/opkgcl.py +++ b/tests/regress/opkgcl.py @@ -43,6 +43,19 @@ def is_installed(pkg_name, version=None): 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 -- cgit v0.9.1