portage.dep._dep_check_strict: Unused, removed
authorSebastian Luther <SebastianLuther@gmx.de>
Tue, 10 Aug 2010 19:23:25 +0000 (21:23 +0200)
committerZac Medico <zmedico@gentoo.org>
Wed, 11 Aug 2010 05:28:57 +0000 (22:28 -0700)
bin/ebuild
bin/repoman
pym/_emerge/BlockerDB.py
pym/_emerge/actions.py
pym/_emerge/depgraph.py
pym/_emerge/main.py
pym/portage/dep/dep_check.py
pym/portage/tests/dep/testAtom.py
pym/portage/tests/dep/test_isvalidatom.py

index 08a68f1008cb8ba84ae9f6062479d520e6d14860..617cad355eff187e26a519f080f5f3ae6fb6bd60 100755 (executable)
@@ -83,8 +83,6 @@ debug = opts.debug
 force = opts.force
 
 import portage.util, portage.const
-import portage.dep
-portage.dep._dep_check_strict = True
 
 # do this _after_ 'import portage' to prevent unnecessary tracing
 if debug and "python-trace" in portage.features:
index fdfd822d7c6ba5cdeaed9ac2f0893ba3f9e81323..24065805ceef5ef79e35294409f739486f84af34 100755 (executable)
@@ -62,8 +62,6 @@ from _emerge.RootConfig import RootConfig
 from _emerge.userquery import userquery
 import portage.checksum
 import portage.const
-import portage.dep
-portage.dep._dep_check_strict = True
 from portage import cvstree, normalize_path
 from portage import util
 from portage.exception import FileNotFound, ParseError, PermissionDenied
index 870d80c4fdb9423403d892e5aa598e333e00a465..8b2a22d8e8b11edb0cf51820a775064bca94f8d7 100644 (file)
@@ -59,13 +59,9 @@ class BlockerDB(object):
                                # Use aux_get() to trigger FakeVartree global
                                # updates on *DEPEND when appropriate.
                                depstr = " ".join(vardb.aux_get(inst_pkg.cpv, dep_keys))
-                               try:
-                                       portage.dep._dep_check_strict = False
-                                       success, atoms = portage.dep_check(depstr,
-                                               vardb, settings, myuse=inst_pkg.use.enabled,
-                                               trees=dep_check_trees, myroot=inst_pkg.root)
-                               finally:
-                                       portage.dep._dep_check_strict = True
+                               success, atoms = portage.dep_check(depstr,
+                                       vardb, settings, myuse=inst_pkg.use.enabled,
+                                       trees=dep_check_trees, myroot=inst_pkg.root)
                                if not success:
                                        pkg_location = os.path.join(inst_pkg.root,
                                                portage.VDB_PATH, inst_pkg.category, inst_pkg.pf)
@@ -98,13 +94,9 @@ class BlockerDB(object):
 
                # Check for blockers in the other direction.
                depstr = " ".join(new_pkg.metadata[k] for k in dep_keys)
-               try:
-                       portage.dep._dep_check_strict = False
-                       success, atoms = portage.dep_check(depstr,
-                               vardb, settings, myuse=new_pkg.use.enabled,
-                               trees=dep_check_trees, myroot=new_pkg.root)
-               finally:
-                       portage.dep._dep_check_strict = True
+               success, atoms = portage.dep_check(depstr,
+                       vardb, settings, myuse=new_pkg.use.enabled,
+                       trees=dep_check_trees, myroot=new_pkg.root)
                if not success:
                        # We should never get this far with invalid deps.
                        show_invalid_depstring_notice(new_pkg, depstr, atoms)
index aeae5e75dddbf8ea7a5fbb6640700f22e3a3034d..7acc9e11d5cc56e5b5fc1deed86f43237bba84e1 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright 1999-2009 Gentoo Foundation
+# Copyright 1999-2010 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 from __future__ import print_function
@@ -1088,14 +1088,10 @@ def calc_depclean(settings, trees, ldpath_mtimes,
                                depstr = node.metadata[dep_type]
                                if not depstr:
                                        continue
-                               try:
-                                       portage.dep._dep_check_strict = False
-                                       success, atoms = portage.dep_check(depstr, None, settings,
-                                               myuse=node_use,
-                                               trees=resolver._dynamic_config._graph_trees,
-                                               myroot=myroot)
-                               finally:
-                                       portage.dep._dep_check_strict = True
+                               success, atoms = portage.dep_check(depstr, None, settings,
+                                       myuse=node_use,
+                                       trees=resolver._dynamic_config._graph_trees,
+                                       myroot=myroot)
                                if not success:
                                        # Ignore invalid deps of packages that will
                                        # be uninstalled anyway.
index 10ad5e4913427b39fb2b5dd1d86253b8c93f1726..cf090d4226e523729bee2550fd3cb1a5064c1926 100644 (file)
@@ -1192,9 +1192,6 @@ class depgraph(object):
                debug = "--debug" in self._frozen_config.myopts
                strict = mytype != "installed"
                try:
-                       if not strict:
-                               portage.dep._dep_check_strict = False
-
                        for dep_root, dep_string, dep_priority, ignore_blockers in deps:
                                if not dep_string:
                                        continue
@@ -1250,8 +1247,6 @@ class depgraph(object):
                        portage.writemsg("!!! Please notify the package maintainer " + \
                                "that atoms must be fully-qualified.\n", noiselevel=-1)
                        return 0
-               finally:
-                       portage.dep._dep_check_strict = True
                self._dynamic_config._traversed_pkg_deps.add(pkg)
                return 1
 
@@ -2151,8 +2146,6 @@ class depgraph(object):
                                        trees[root]["atom_graph"] = atom_graph
                                if priority is not None:
                                        trees[root]["priority"] = priority
-                               if not strict:
-                                       portage.dep._dep_check_strict = False
                                mycheck = portage.dep_check(depstring, None,
                                        pkgsettings, myuse=myuse,
                                        myroot=root, trees=trees)
@@ -2164,7 +2157,6 @@ class depgraph(object):
                                        trees[root].pop("atom_graph")
                                if priority is not None:
                                        trees[root].pop("priority")
-                               portage.dep._dep_check_strict = True
                        if not mycheck[0]:
                                raise portage.exception.InvalidDependString(mycheck[1])
                if parent is None:
@@ -3291,24 +3283,20 @@ class depgraph(object):
                                                # optimize dep_check calls by eliminating atoms via
                                                # dep_wordreduce and dep_eval calls.
                                                try:
-                                                       portage.dep._dep_check_strict = False
-                                                       try:
-                                                               success, atoms = portage.dep_check(depstr,
-                                                                       final_db, pkgsettings, myuse=self._pkg_use_enabled(pkg),
-                                                                       trees=self._dynamic_config._graph_trees, myroot=myroot)
-                                                       except Exception as e:
-                                                               if isinstance(e, SystemExit):
-                                                                       raise
-                                                               # This is helpful, for example, if a ValueError
-                                                               # is thrown from cpv_expand due to multiple
-                                                               # matches (this can happen if an atom lacks a
-                                                               # category).
-                                                               show_invalid_depstring_notice(
-                                                                       pkg, depstr, str(e))
-                                                               del e
+                                                       success, atoms = portage.dep_check(depstr,
+                                                               final_db, pkgsettings, myuse=self._pkg_use_enabled(pkg),
+                                                               trees=self._dynamic_config._graph_trees, myroot=myroot)
+                                               except Exception as e:
+                                                       if isinstance(e, SystemExit):
                                                                raise
-                                               finally:
-                                                       portage.dep._dep_check_strict = True
+                                                       # This is helpful, for example, if a ValueError
+                                                       # is thrown from cpv_expand due to multiple
+                                                       # matches (this can happen if an atom lacks a
+                                                       # category).
+                                                       show_invalid_depstring_notice(
+                                                               pkg, depstr, str(e))
+                                                       del e
+                                                       raise
                                                if not success:
                                                        replacement_pkg = final_db.match_pkgs(pkg.slot_atom)
                                                        if replacement_pkg and \
index aa5891f9073c8412e7c374dfa3a783bb1cd6aec1..f8a8f22e49b9d641a4c4075b6f6cf54b534b7e03 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright 1999-2009 Gentoo Foundation
+# Copyright 1999-2010 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 from __future__ import print_function
@@ -25,8 +25,6 @@ good = create_color_func("GOOD")
 bad = create_color_func("BAD")
 
 import portage.elog
-import portage.dep
-portage.dep._dep_check_strict = True
 import portage.util
 import portage.locks
 import portage.exception
index dd6864227fb4ded5f202aded08e8c5a4d56539f7..6ca96967f19921893d80e9943c06536438ea9a8a 100644 (file)
@@ -61,19 +61,14 @@ def _expand_new_virtuals(mysplit, edebug, mydbapi, mysettings, myroot="/",
                        try:
                                x = Atom(x)
                        except InvalidAtom:
-                               if portage.dep._dep_check_strict:
-                                       raise ParseError(
-                                               _("invalid atom: '%s'") % x)
-                               else:
-                                       # Only real Atom instances are allowed past this point.
-                                       continue
+                               raise ParseError(
+                                       _("invalid atom: '%s'") % x)
                        else:
                                if x.blocker and x.blocker.overlap.forbid and \
-                                       eapi in ("0", "1") and portage.dep._dep_check_strict:
+                                       eapi in ("0", "1"):
                                        raise ParseError(
                                                _("invalid atom: '%s'") % (x,))
-                               if x.use and eapi in ("0", "1") and \
-                                       portage.dep._dep_check_strict:
+                               if x.use and eapi in ("0", "1"):
                                        raise ParseError(
                                                _("invalid atom: '%s'") % (x,))
 
@@ -569,15 +564,8 @@ def dep_check(depstring, mydbapi, mysettings, use="yes", mode=None, myuse=None,
        writemsg("mysplit:  %s\n" % (mysplit), 1)
        writemsg("mysplit2: %s\n" % (mysplit2), 1)
 
-       try:
-               selected_atoms = dep_zapdeps(mysplit, mysplit2, myroot,
-                       use_binaries=use_binaries, trees=trees)
-       except InvalidAtom as e:
-               if portage.dep._dep_check_strict:
-                       raise # This shouldn't happen.
-               # dbapi.match() failed due to an invalid atom in
-               # the dependencies of an installed package.
-               return [0, _("Invalid atom: '%s'") % (e,)]
+       selected_atoms = dep_zapdeps(mysplit, mysplit2, myroot,
+               use_binaries=use_binaries, trees=trees)
 
        return [1, selected_atoms]
 
index 35f8e5f2e401d1f7d57ce77af28d7501c35881f7..cd4275eaeb7f4c20dfcefcb1cd890f4e44bfd8b0 100644 (file)
@@ -4,8 +4,7 @@
 
 from portage.tests import TestCase
 from portage.dep import Atom
-import portage.dep
-portage.dep._dep_check_strict = True
+from portage.exception import InvalidAtom
 
 class TestAtom(TestCase):
        """ A simple testcase for isvalidatom
@@ -86,7 +85,7 @@ class TestAtom(TestCase):
                                msg="Atom('%s').use == '%s'" % ( atom, a.use ) )
 
                for atom, allow_wildcard in tests_xfail:
-                       self.assertRaisesMsg(atom, portage.exception.InvalidAtom, Atom, atom)
+                       self.assertRaisesMsg(atom, InvalidAtom, Atom, atom)
 
        def test_violated_conditionals(self):
                test_cases = (
@@ -135,5 +134,5 @@ class TestAtom(TestCase):
 
                for atom, other_use, parent_use in test_cases_xfail:
                        a = Atom(atom)
-                       self.assertRaisesMsg(atom, portage.exception.InvalidAtom, \
+                       self.assertRaisesMsg(atom, InvalidAtom, \
                                a.violated_conditionals, other_use, parent_use)
index 54a930385c94b6cf2d9d40afd08b8e469928b3ca..8f8ce3e0194948d3a7781f73cd4d79ee52c04e4b 100644 (file)
@@ -4,8 +4,6 @@
 
 from portage.tests import TestCase
 from portage.dep import isvalidatom
-import portage.dep
-portage.dep._dep_check_strict = True
 
 class IsValidAtom(TestCase):
        """ A simple testcase for isvalidatom