commit:     51f100e42753d6ffd3a24dfcb2ff8af0aa34966e
Author:     Lucian Poston <lucian.poston <AT> gmail <DOT> com>
AuthorDate: Sat Jan  2 23:05:28 2016 +0000
Commit:     Alexander Berntsen <bernalex <AT> gentoo <DOT> org>
CommitDate: Mon Jan  4 10:34:55 2016 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=51f100e4

emerge: Add --autounmask-only parameter (bug 570672)

The --autounmask-only parameter will display autounmask messages,
perform autounmasking (in accordance with the other --autounmask-*
parameters), and exit with success (return value 0).

X-Gentoo-Bug: 570672
X-Gentoo-Bug-url: https://bugs.gentoo.org/show_bug.cgi?id=570672

 man/emerge.1           |  6 ++++++
 pym/_emerge/actions.py |  4 ++++
 pym/_emerge/main.py    | 11 +++++++++++
 3 files changed, 21 insertions(+)

diff --git a/man/emerge.1 b/man/emerge.1
index c03f044..05b2a01 100644
--- a/man/emerge.1
+++ b/man/emerge.1
@@ -361,6 +361,12 @@ the specified configuration file(s), or enable the
 \fBEMERGE_DEFAULT_OPTS\fR variable may be used to
 disable this option by default in \fBmake.conf\fR(5).
 .TP
+.BR "\-\-autounmask\-only [ y | n ]"
+Instead of doing any package building, just unmask
+packages and generate package.use settings as necessary
+to satisfy dependencies. This option is disabled by
+default.
+.TP
 .BR "\-\-autounmask\-unrestricted\-atoms [ y | n ]"
 If \-\-autounmask is enabled, keyword and mask changes
 using the \'=\' operator will be written. With this

diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index c3b0b98..59626ad 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -327,6 +327,10 @@ def action_build(settings, trees, mtimedb,
                        display_missing_pkg_set(root_config, e.value)
                        return 1
 
+               if "--autounmask-only" in myopts:
+                       mydepgraph.display_problems()
+                       return 0
+
                if not success:
                        mydepgraph.display_problems()
                        return 1

diff --git a/pym/_emerge/main.py b/pym/_emerge/main.py
index 5a8b93c..5dbafee 100644
--- a/pym/_emerge/main.py
+++ b/pym/_emerge/main.py
@@ -127,6 +127,7 @@ def insert_optional_args(args):
                '--alert'                : y_or_n,
                '--ask'                  : y_or_n,
                '--autounmask'           : y_or_n,
+               '--autounmask-only'      : y_or_n,
                '--autounmask-keep-masks': y_or_n,
                '--autounmask-unrestricted-atoms' : y_or_n,
                '--autounmask-write'     : y_or_n,
@@ -323,6 +324,11 @@ def parse_opts(tmpcmdline, silent=False):
                        "choices" : true_y_or_n
                },
 
+               "--autounmask-only": {
+                       "help"    : "only perform --autounmask",
+                       "choices" : true_y_or_n
+               },
+
                "--autounmask-unrestricted-atoms": {
                        "help"    : "write autounmask changes with >= atoms if 
possible",
                        "choices" : true_y_or_n
@@ -745,6 +751,11 @@ def parse_opts(tmpcmdline, silent=False):
        if myoptions.autounmask in true_y:
                myoptions.autounmask = True
 
+       if myoptions.autounmask_only in true_y:
+               myoptions.autounmask_only = True
+       else:
+               myoptions.autounmask_only = None
+
        if myoptions.autounmask_unrestricted_atoms in true_y:
                myoptions.autounmask_unrestricted_atoms = True
 

Reply via email to