depgraph: make empty param imply deep = True
authorZac Medico <zmedico@gentoo.org>
Sun, 13 Feb 2011 09:06:39 +0000 (01:06 -0800)
committerZac Medico <zmedico@gentoo.org>
Sun, 13 Feb 2011 09:06:39 +0000 (01:06 -0800)
This won't change the existing depgraph behavior, but it will allow
logic to be simplified in some cases such that solely the deep param
needs to be consulted (rather than needing to consult both empty and
deep params).

pym/_emerge/create_depgraph_params.py

index 375332e9049a45c2f39be61f62a4c949dbebb088..454363e6ab7be63054dc3c94c8c21d5c0d0d6681 100644 (file)
@@ -29,15 +29,16 @@ def create_depgraph_params(myopts, myaction):
                "--noreplace" in myopts or \
                myopts.get("--selective", "n") != "n":
                myparams["selective"] = True
-       if "--emptytree" in myopts:
-               myparams["empty"] = True
-               myparams.pop("selective", None)
        if "--nodeps" in myopts:
                myparams.pop("recurse", None)
        if "--deep" in myopts:
                myparams["deep"] = myopts["--deep"]
        if "--complete-graph" in myopts:
                myparams["complete"] = True
+       if "--emptytree" in myopts:
+               myparams["empty"] = True
+               myparams["deep"] = True
+               myparams.pop("selective", None)
 
        rebuilt_binaries = myopts.get('--rebuilt-binaries')
        if rebuilt_binaries is True or \