[gentoo-commits] proj/portage:master commit in: pym/portage/tests/resolver/, pym/_emerge/, man/

2017-08-12 Thread Zac Medico
commit: 46fac6698e5c73fda964819b508f1fe9dd341393
Author: Zac Medico  gentoo  org>
AuthorDate: Sat Aug 12 17:16:46 2017 +
Commit: Zac Medico  gentoo  org>
CommitDate: Sat Aug 12 23:48:14 2017 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=46fac669

emerge: add --autounmask-keep-keywords option (bug 622480)

The option prevents --autounmask from making changes to
package.accept_keywords. This option does not imply
--autounmask-keep-masks, so --autounmask is still allowed
to create package.unmask changes unless the
--autounmask-keep-masks is also specified.

X-Gentoo-bug: 622480
X-Gentoo-bug-url: https://bugs.gentoo.org/622480
Reviewed-by: Manuel RĂ¼ger  gentoo.org>

 man/emerge.1   |  7 +++
 pym/_emerge/depgraph.py| 12 ++--
 pym/_emerge/main.py|  9 +++
 .../resolver/test_autounmask_keep_keywords.py  | 72 ++
 4 files changed, 96 insertions(+), 4 deletions(-)

diff --git a/man/emerge.1 b/man/emerge.1
index ffb453efb..12a0db166 100644
--- a/man/emerge.1
+++ b/man/emerge.1
@@ -395,6 +395,13 @@ 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\-keywords [ y | n ]"
+If \-\-autounmask is enabled, no package.accept_keywords changes will
+be created. This leads to unsatisfied dependencies if any keyword
+changes are required. This option does not imply \-\-autounmask\-keep\-masks,
+so \-\-autounmask is still allowed to create package.unmask changes unless
+the \-\-autounmask\-keep\-masks is also specified.
+.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

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index abe2cb1bd..b4fc5f297 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -5707,6 +5707,7 @@ class depgraph(object):
if self._dynamic_config._autounmask is not True:
return
 
+   autounmask_keep_keywords = 
self._frozen_config.myopts.get("--autounmask-keep-keywords", "n") != "n"
autounmask_keep_masks = 
self._frozen_config.myopts.get("--autounmask-keep-masks", "n") != "n"
autounmask_level = self._AutounmaskLevel()
 
@@ -5716,14 +5717,16 @@ class depgraph(object):
autounmask_level.allow_license_changes = True
yield autounmask_level
 
-   autounmask_level.allow_unstable_keywords = True
-   yield autounmask_level
-
-   if not autounmask_keep_masks:
+   if not autounmask_keep_keywords:
+   autounmask_level.allow_unstable_keywords = True
+   yield autounmask_level
 
+   if not (autounmask_keep_keywords or autounmask_keep_masks):
+   autounmask_level.allow_unstable_keywords = True
autounmask_level.allow_missing_keywords = True
yield autounmask_level
 
+   if not autounmask_keep_masks:
# 4. USE + license + masks
# Try to respect keywords while discarding
# package.mask (see bug #463394).
@@ -5732,6 +5735,7 @@ class depgraph(object):
autounmask_level.allow_unmasks = True
yield autounmask_level
 
+   if not (autounmask_keep_keywords or autounmask_keep_masks):
autounmask_level.allow_unstable_keywords = True
 
for missing_keyword, unmask in ((False, True), (True, 
True)):

diff --git a/pym/_emerge/main.py b/pym/_emerge/main.py
index 2132aa63c..d3a415b91 100644
--- a/pym/_emerge/main.py
+++ b/pym/_emerge/main.py
@@ -129,6 +129,7 @@ def insert_optional_args(args):
'--autounmask'   : y_or_n,
'--autounmask-continue'  : y_or_n,
'--autounmask-only'  : y_or_n,
+   '--autounmask-keep-keywords' : y_or_n,
'--autounmask-keep-masks': y_or_n,
'--autounmask-unrestricted-atoms' : y_or_n,
'--autounmask-write' : y_or_n,
@@ -348,6 +349,11 @@ def parse_opts(tmpcmdline, silent=False):
"choices" : true_y_or_n
},
 
+   "--autounmask-keep-keywords": {
+   "help": "don't add package.accept_keywords entries",
+   "choices" : true_y_or_n
+   },
+
"--autounmask-keep-masks": {
"help": "don't add package.unmask entries",
"choices" : true_y_or_n
@@ -797,6 +803,9 @@ def parse_opts(tmpcmdline, silent=False):
if 

[gentoo-commits] proj/portage:master commit in: pym/portage/tests/resolver/, pym/_emerge/, man/

2015-01-18 Thread Zac Medico
commit: 1891388ea0ae0dd58903a71a3adc779731523601
Author: Zac Medico zmedico AT gentoo DOT org
AuthorDate: Sat Jan 17 22:56:47 2015 +
Commit: Zac Medico zmedico AT gentoo DOT org
CommitDate: Sun Jan 18 18:54:24 2015 +
URL:
http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=1891388e

emerge: default --backtrack=3 (bug #536926)

The previous default emerge --backtrack=10 setting could lead to lots
of wasted cpu time in cases where it will ultimately fail to find a
valid solution anyway. Therefore, reduce the default to --backtrack=3.

In order for the BacktrackingTestCase.testBacktrackNoWrongRebuilds to
succeed, the test now needs to specify --backtrack=6. This is a rather
obscure case though, so it does not seem worthwhile to increase the
default because of it.

X-Gentoo-Bug: 536926
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=536926
Acked-by: Brian Dolbec dolsen AT gentoo.org

---
 man/emerge.1| 2 +-
 pym/_emerge/depgraph.py | 2 +-
 pym/portage/tests/resolver/test_backtracking.py | 9 +++--
 3 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/man/emerge.1 b/man/emerge.1
index aea7cae..fd9140f 100644
--- a/man/emerge.1
+++ b/man/emerge.1
@@ -384,7 +384,7 @@ precedence over existing changes. This option is 
automatically enabled with
 .BR \-\-backtrack=COUNT
 Specifies an integer number of times to backtrack if
 dependency calculation fails due to a conflict or an
-unsatisfied dependency (default: \'10\').
+unsatisfied dependency (default: \'3\').
 .TP
 .BR \-\-binpkg\-changed\-deps [ y | n ]
 Tells emerge to ignore binary packages for which the corresponding

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 3e9bfdd..1184dd6 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -8950,7 +8950,7 @@ def _backtrack_depgraph(settings, trees, myopts, 
myparams, myaction, myfiles, sp
 
debug = --debug in myopts
mydepgraph = None
-   max_retries = myopts.get('--backtrack', 10)
+   max_retries = myopts.get('--backtrack', 3)
max_depth = max(1, (max_retries + 1) // 2)
allow_backtracking = max_retries  0
backtracker = Backtracker(max_depth)

diff --git a/pym/portage/tests/resolver/test_backtracking.py 
b/pym/portage/tests/resolver/test_backtracking.py
index 3b69eda..6567153 100644
--- a/pym/portage/tests/resolver/test_backtracking.py
+++ b/pym/portage/tests/resolver/test_backtracking.py
@@ -1,4 +1,4 @@
-# Copyright 2010-2014 Gentoo Foundation
+# Copyright 2010-2015 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 from portage.tests import TestCase
@@ -154,7 +154,12 @@ class BacktrackingTestCase(TestCase):
 
world = [dev-libs/B, dev-libs/C]
 
-   options = {'--update' : True, '--deep' : True, '--selective' : 
True}
+   options = {
+   '--backtrack': 6,
+   '--deep' : True,
+   '--selective' : True,
+   '--update' : True,
+   }
 
test_cases = (
ResolverPlaygroundTestCase(