From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 95C13138247 for ; Thu, 21 Nov 2013 09:21:09 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id DC110E09F8; Thu, 21 Nov 2013 09:21:04 +0000 (UTC) Received: from mail.plaimi.net (107.4.189.109.customer.cdi.no [109.189.4.107]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 0F2E3E09F6 for ; Thu, 21 Nov 2013 09:21:03 +0000 (UTC) Received: by mail.plaimi.net (Postfix) with ESMTPSA id DF19A40702 for ; Thu, 21 Nov 2013 10:21:00 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=plaimi.net; s=leet; t=1385025661; bh=5qaNqpRG11wbT/Eq47Nshzq6mb26kALNhKZB86kh+KE=; h=Message-ID:Date:From:MIME-Version:To:Subject:Content-Type; b=AT99PmiGYxk4HxEGMQijje8IFDT5umdz/WYhf+D2YeyiBoT5ISfTfR2acsNFbL1KT CC9UUL6SVw/CLX2BORdZF1t1ey8W9w5Oit026ICgBeV9gfYfBjJfOoR2ZPXSpa+V5S JwErLPL6V3HkIHLRJfGNsfgm67uZvw9n7UWf7fcM= Message-ID: <528DD07E.3010603@plaimi.net> Date: Thu, 21 Nov 2013 10:21:02 +0100 From: Alexander Berntsen User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20131001 Thunderbird/17.0.9 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-portage-dev@lists.gentoo.org Reply-to: gentoo-portage-dev@lists.gentoo.org MIME-Version: 1.0 To: gentoo-portage-dev@lists.gentoo.org Subject: [gentoo-portage-dev] [PATCHES] Remove --autounmask, rename --autounmask-write to --autounmask X-Enigmail-Version: 1.5.2 Content-Type: multipart/mixed; boundary="------------030504020805050402050708" X-Archives-Salt: c8d12ad0-705c-4563-8a74-058218f1ab9c X-Archives-Hash: 2ced3b466aeacff304ce970711aec541 This is a multi-part message in MIME format. --------------030504020805050402050708 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 After talking to zmedico privately, and raising the issue and discussing it with people in bug #481578[0], I implemented the behaviour described in a comment[1] on said bug. I sent this to zmedico almost two months ago, but it doesn't look like he's coming back any time soon, so I'm sending it here and ask someone to review and commit it (a role zmedico has typically played for me, as well as being my "mentor" and guide and so on and so forth for Portage hacking). [0] [1] > - -- Alexander alexander@plaimi.net http://plaimi.net/~alexander -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iF4EAREIAAYFAlKN0H0ACgkQRtClrXBQc7Vh/QD/WQRV+zK8Dgjmm2trFOG/tA1G A3D5PjKWOz+r9uCvu+YBAJauUd/7KkiVyn6ozKfGKxJaRdqETGPbYaJc9rcXQc1b =ZX2u -----END PGP SIGNATURE----- --------------030504020805050402050708 Content-Type: text/x-diff; name="0001-emerge-Deprecate-autounmask.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="0001-emerge-Deprecate-autounmask.patch" >From 887d7c8e179f4f011047e42b547cf46261fb10c0 Mon Sep 17 00:00:00 2001 From: Alexander Berntsen Date: Tue, 1 Oct 2013 11:40:55 +0200 Subject: [PATCH 1/3] emerge: Deprecate --autounmask Remove the --autounmask option from emerge. Please note that removing the option does not mean that the variable used for keeping track of autounmasking is not removed from depgraph.py. --- man/emerge.1 | 33 ++++++++++----------------------- pym/_emerge/depgraph.py | 3 +-- pym/_emerge/main.py | 9 --------- 3 files changed, 11 insertions(+), 34 deletions(-) diff --git a/man/emerge.1 b/man/emerge.1 index c59185f..58bdc94 100644 --- a/man/emerge.1 +++ b/man/emerge.1 @@ -322,38 +322,25 @@ 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. -.TP -.BR "\-\-autounmask [ y | n ]" -Automatically unmask packages and generate package.use -settings as necessary to satisfy dependencies. This -option is enabled by default. If any configuration -changes are required, then they will be displayed -after the merge list and emerge will immediately -abort. If the displayed configuration changes are -satisfactory, you should copy and paste them into -the specified configuration file(s), or enable the \fB\-\-autounmask\-write\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\-unrestricted\-atoms [ y | n ]" -If \-\-autounmask is enabled, keyword and mask changes -using the \'=\' operator will be written. With this -option, \'>=\' operators will be used whenever possible. -USE and license changes always use the latter behavior. +Keyword and mask changes using the \'=\' operator will be written. With this +option, \'>=\' operators will be used whenever possible. USE and license +changes always use the latter behavior. .TP .BR "\-\-autounmask\-keep\-masks [ y | n ]" -If \-\-autounmask is enabled, no package.unmask or ** keyword changes -will be created. This leads to unsatisfied dependencies if -no other solution exists. +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 ]" -If \-\-autounmask is enabled, changes are written -to 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. +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 diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py index 7b77edc..9fdfa43 100644 --- a/pym/_emerge/depgraph.py +++ b/pym/_emerge/depgraph.py @@ -427,7 +427,7 @@ class _dynamic_depgraph_config(object): self._backtrack_infos = {} self._buildpkgonly_deps_unsatisfied = False - self._autounmask = depgraph._frozen_config.myopts.get('--autounmask') != 'n' + self._autounmask = True self._success_without_autounmask = False self._traverse_ignored_deps = False self._complete_mode = False @@ -7971,7 +7971,6 @@ def _backtrack_depgraph(settings, trees, myopts, myparams, myaction, myfiles, sp "\n\nautounmask breakage detected\n\n", noiselevel=-1, level=logging.DEBUG) mydepgraph.display_problems() - myopts["--autounmask"] = "n" mydepgraph = depgraph(settings, trees, myopts, myparams, spinner, frozen_config=frozen_config, allow_backtracking=False) success, favorites = mydepgraph.select_files(myfiles) diff --git a/pym/_emerge/main.py b/pym/_emerge/main.py index 89413a9..fc73ef7 100644 --- a/pym/_emerge/main.py +++ b/pym/_emerge/main.py @@ -123,7 +123,6 @@ def insert_optional_args(args): default_arg_opts = { '--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, @@ -303,11 +302,6 @@ 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 @@ -673,9 +667,6 @@ 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 -- 1.8.1.5 --------------030504020805050402050708 Content-Type: text/x-diff; name="0002-emerge-Rename-autounmask-write-to-autounmask.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="0002-emerge-Rename-autounmask-write-to-autounmask.patch" >From b425e5e375c4aa058e4b7efa41d15bd0487b6b12 Mon Sep 17 00:00:00 2001 From: Alexander Berntsen Date: Tue, 1 Oct 2013 11:53:31 +0200 Subject: [PATCH 2/3] emerge: Rename --autounmask-write to --autounmask 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 not removed from depgraph.py. --- 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 58bdc94..e23d1b4 100644 --- a/man/emerge.1 +++ b/man/emerge.1 @@ -322,10 +322,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 @@ -335,13 +345,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 9fdfa43..5b4b723 100644 --- a/pym/_emerge/depgraph.py +++ b/pym/_emerge/depgraph.py @@ -6806,7 +6806,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 @@ -7168,7 +7168,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 fc73ef7..247317d 100644 --- a/pym/_emerge/main.py +++ b/pym/_emerge/main.py @@ -123,9 +123,9 @@ def insert_optional_args(args): default_arg_opts = { '--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, @@ -302,6 +302,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 @@ -312,11 +317,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" @@ -667,15 +667,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.1.5 --------------030504020805050402050708 Content-Type: text/x-diff; name="0003-emerge-Make-autounmask-y-if-ask-y.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="0003-emerge-Make-autounmask-y-if-ask-y.patch" >From 9c03d52526f58eb53c9e76785352fbb53413898d Mon Sep 17 00:00:00 2001 From: Alexander Berntsen Date: Tue, 1 Oct 2013 12:10:14 +0200 Subject: [PATCH 3/3] emerge: Make --autounmask=y if --ask=y --- man/emerge.1 | 9 +++++---- pym/_emerge/depgraph.py | 5 +++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/man/emerge.1 b/man/emerge.1 index e23d1b4..52f8ed7 100644 --- a/man/emerge.1 +++ b/man/emerge.1 @@ -331,10 +331,11 @@ 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. +itself. This option is enabled by default if are running emerge with +\fB\-\-ask\fR or \fB\-\-pretend\fR, and disabled by default elsewise. 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 diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py index 5b4b723..e8b680d 100644 --- a/pym/_emerge/depgraph.py +++ b/pym/_emerge/depgraph.py @@ -6806,12 +6806,13 @@ class depgraph(object): (using CONFIG_PROTECT). The message includes the comments and the changes. """ - autounmask_write = self._frozen_config.myopts.get("--autounmask", "n") == True + ask = "--ask" in self._frozen_config.myopts + autounmask_write = ask or \ + 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 pretend = "--pretend" in self._frozen_config.myopts - ask = "--ask" in self._frozen_config.myopts enter_invalid = '--ask-enter-invalid' in self._frozen_config.myopts def check_if_latest(pkg): -- 1.8.1.5 --------------030504020805050402050708--