public inbox for gentoo-portage-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: Alexander Berntsen <bernalex@gentoo.org>
To: gentoo-portage-dev@lists.gentoo.org
Cc: Alexander Berntsen <alexander@plaimi.net>
Subject: [gentoo-portage-dev] [PATCH 2/4] emerge: Rename --autounmask-write to --autounmask
Date: Tue, 12 Aug 2014 11:37:13 +0200	[thread overview]
Message-ID: <1407836235-13528-3-git-send-email-bernalex@gentoo.org> (raw)
In-Reply-To: <1407836235-13528-1-git-send-email-bernalex@gentoo.org>

From: Alexander Berntsen <alexander@plaimi.net>

Rename --autounmask-write to --autounmask. Please note that removing the
option does not mean that the variable used for keeping track of
autounmask writing is removed from depgraph.py.

Signed-off-by: Alexander Berntsen <bernalex@gentoo.org>
---
 man/emerge.1            | 19 +++++++++++--------
 pym/_emerge/depgraph.py |  4 ++--
 pym/_emerge/main.py     | 18 +++++++++---------
 3 files changed, 22 insertions(+), 19 deletions(-)

diff --git a/man/emerge.1 b/man/emerge.1
index d0a0806..be52f25 100644
--- a/man/emerge.1
+++ b/man/emerge.1
@@ -336,10 +336,20 @@ invalid input. This helps prevent accidental
 acceptance of the first choice. This option is
 intended to be set in the \fBmake.conf\fR(5)
 \fBEMERGE_DEFAULT_OPTS\fR variable.
-\fB\-\-autounmask\-write\fR option. The
+\fB\-\-autounmask\fR option. The
 \fBEMERGE_DEFAULT_OPTS\fR variable may be used to
 disable this option by default in \fBmake.conf\fR(5).
 .TP
+.BR "\-\-autounmask [ y | n ]"
+Write required unmask changes to the relevant config files, respecting
+\fBCONFIG_PROTECT\fR. If invoked together with \fB\-\-ask\fR, emerge will
+prompt you to write the changes. If invoked along with \fB\-\-pretend\fR,
+emerge will merely output the required changes and not make any of them by
+itself. If the corresponding package.* is a file, the changes are appended to
+it, if it is a directory, changes are written to the lexicographically last
+file. This way it is always ensured that the new changes take precedence over
+existing changes.
+.TP
 .BR "\-\-autounmask\-unrestricted\-atoms [ y | n ]"
 Keyword and mask changes using the \'=\' operator will be written. With this
 option, \'>=\' operators will be used whenever possible. USE and license
@@ -349,13 +359,6 @@ changes always use the latter behavior.
 No package.unmask or ** keyword changes will be created if this is activated.
 This leads to unsatisfied dependencies if no other solution exists.
 .TP
-.BR "\-\-autounmask\-write [ y | n ]"
-Write required unmask changes to the relevant config files, respecting
-\fBCONFIG_PROTECT\fR and \fB\-\-ask\fR. If the corresponding package.* is a
-file, the changes are appended to it, if it is a directory, changes are written
-to the lexicographically last file. This way it is always ensured that the new
-changes take precedence over existing changes.
-.TP
 .BR \-\-backtrack=COUNT
 Specifies an integer number of times to backtrack if
 dependency calculation fails due to a conflict or an
diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index b0cfc92..0c6b8e3 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -7332,7 +7332,7 @@ class depgraph(object):
 		(using CONFIG_PROTECT). The message includes the comments and the changes.
 		"""
 
-		autounmask_write = self._frozen_config.myopts.get("--autounmask-write", "n") == True
+		autounmask_write = self._frozen_config.myopts.get("--autounmask", "n") == True
 		autounmask_unrestricted_atoms = \
 			self._frozen_config.myopts.get("--autounmask-unrestricted-atoms", "n") == True
 		quiet = "--quiet" in self._frozen_config.myopts
@@ -7694,7 +7694,7 @@ class depgraph(object):
 				chk_updated_cfg_files(root,
 					[os.path.join(os.sep, USER_CONFIG_PATH)])
 		elif not pretend and not autounmask_write and roots:
-			writemsg("\nUse --autounmask-write to write changes to config files (honoring\n"
+			writemsg("\nUse --autounmask to write changes to config files (honoring\n"
 				"CONFIG_PROTECT). Carefully examine the list of proposed changes,\n"
 				"paying special attention to mask or keyword changes that may expose\n"
 				"experimental or unstable packages.\n",
diff --git a/pym/_emerge/main.py b/pym/_emerge/main.py
index 86c0c62..f450fa2 100644
--- a/pym/_emerge/main.py
+++ b/pym/_emerge/main.py
@@ -126,9 +126,9 @@ def insert_optional_args(args):
 	default_arg_opts = {
 		'--alert'                : y_or_n,
 		'--ask'                  : y_or_n,
+		'--autounmask'           : y_or_n,
 		'--autounmask-keep-masks': y_or_n,
 		'--autounmask-unrestricted-atoms' : y_or_n,
-		'--autounmask-write'     : y_or_n,
 		'--buildpkg'             : y_or_n,
 		'--complete-graph'       : y_or_n,
 		'--deep'       : valid_integers,
@@ -313,6 +313,11 @@ def parse_opts(tmpcmdline, silent=False):
 			"choices" : true_y_or_n
 		},
 
+		"--autounmask": {
+			"help"    : "automatically unmask packages",
+			"choices" : true_y_or_n
+		},
+
 		"--autounmask-unrestricted-atoms": {
 			"help"    : "write autounmask changes with >= atoms if possible",
 			"choices" : true_y_or_n
@@ -323,11 +328,6 @@ def parse_opts(tmpcmdline, silent=False):
 			"choices" : true_y_or_n
 		},
 
-		"--autounmask-write": {
-			"help"    : "write changes made by --autounmask to disk",
-			"choices" : true_y_or_n
-		},
-
 		"--accept-properties": {
 			"help":"temporarily override ACCEPT_PROPERTIES",
 			"action":"store"
@@ -687,15 +687,15 @@ def parse_opts(tmpcmdline, silent=False):
 	else:
 		myoptions.ask = None
 
+	if myoptions.autounmask in true_y:
+		myoptions.autounmask = True
+
 	if myoptions.autounmask_unrestricted_atoms in true_y:
 		myoptions.autounmask_unrestricted_atoms = True
 
 	if myoptions.autounmask_keep_masks in true_y:
 		myoptions.autounmask_keep_masks = True
 
-	if myoptions.autounmask_write in true_y:
-		myoptions.autounmask_write = True
-
 	if myoptions.buildpkg in true_y:
 		myoptions.buildpkg = True
 
-- 
1.8.5.5



  parent reply	other threads:[~2014-08-12  9:37 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-12  9:37 [gentoo-portage-dev] [PATCH 0/4] Autounmask changes Alexander Berntsen
2014-08-12  9:37 ` [gentoo-portage-dev] [PATCH 1/4] emerge: Deprecate --autounmask Alexander Berntsen
2014-08-12  9:37 ` Alexander Berntsen [this message]
2014-08-12  9:37 ` [gentoo-portage-dev] [PATCH 3/4] emerge: Make --autounmask=y if --ask=y Alexander Berntsen
2014-08-12  9:37 ` [gentoo-portage-dev] [PATCH 4/4] emerge: Let --autounmask=n override other options Alexander Berntsen
2014-08-13 16:06 ` [gentoo-portage-dev] [PATCH 0/4] Autounmask changes Alexander Berntsen
2014-08-13 16:45   ` Brian Dolbec
2014-08-13 16:56     ` Alexander Berntsen
2014-08-13 17:59       ` [gentoo-portage-dev] " Duncan
2014-08-13 18:39         ` Alexander Berntsen
2014-08-13 19:24         ` Wyatt Epp
2014-08-13 19:39           ` Alexander Berntsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1407836235-13528-3-git-send-email-bernalex@gentoo.org \
    --to=bernalex@gentoo.org \
    --cc=alexander@plaimi.net \
    --cc=gentoo-portage-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox