From f27145ec49c6f1cdd13db2f3bf389164f10ac828 Mon Sep 17 00:00:00 2001 From: necoro <> Date: Sun, 8 Oct 2006 17:26:27 +0000 Subject: Made the testing stuff working too ... I hope ^^ ... removed obsolete-dir --- geneticone/backend/flags.py | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) (limited to 'geneticone/backend/flags.py') diff --git a/geneticone/backend/flags.py b/geneticone/backend/flags.py index 1251bfd..2da0a94 100644 --- a/geneticone/backend/flags.py +++ b/geneticone/backend/flags.py @@ -468,6 +468,26 @@ TESTING_PATH_IS_DIR = os.path.isdir(TESTING_PATH) newTesting = {} arch = "" +def remove_new_testing (cpv): + if isinstance(cpv, package.Package): + cpv = cpv.get_cpv() + + try: + del newTesting[cpv] + except KeyError: + pass + +def new_testing_status (cpv): + if isinstance(cpv, package.Package): + cpv = cpv.get_cpv() + + if cpv in newTesting: + for file, line in newTesting[cpv]: + if line == "-1": return False + else: return True + + return None + def set_testing (pkg, enable): """Enables the package for installing when it is marked as testing (~ARCH). @param pkg: the package @@ -484,12 +504,11 @@ def set_testing (pkg, enable): if not cpv in newTesting: newTesting[cpv] = [] - debug("arch: "+arch) for file, line in newTesting[cpv]: if (enable and line != "-1") or (not enable and line == "-1"): newTesting[cpv].remove((file, line)) - if (enable and (pkg.get_mask_status() % 3 == 0)) or (not enable and (pkg.get_mask_status() % 3 != 0)): + if (enable and not pkg.is_testing(allowed=True)) or (not enable and pkg.is_testing(allowed=True)): return if not enable: -- cgit v1.2.3-54-g00ecf