From: "Zac Medico" <zmedico@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/portage:master commit in: man/, pym/_emerge/
Date: Mon, 19 Sep 2011 14:15:53 +0000 (UTC) [thread overview]
Message-ID: <7e956a6ec65b9b48a9fca3e928e7c7b56fd066b6.zmedico@gentoo> (raw)
commit: 7e956a6ec65b9b48a9fca3e928e7c7b56fd066b6
Author: Sebastian Luther <SebastianLuther <AT> gmx <DOT> de>
AuthorDate: Mon Sep 19 11:45:35 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Sep 19 14:10:04 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=7e956a6e
autounmask: Add --autounmask-unrestricted-atoms option
The default behavior of --autounmask is now changed back to
the original one, namely to use '=' operators. The
--autounmask-unrestricted-atoms option allows the use of '>='
operators whenever possible. This addresses the issues raised
in bugs 372405, 374331 and 379333.
---
man/emerge.1 | 5 +++++
pym/_emerge/depgraph.py | 46 ++++++++++++++++++++++++++++++----------------
pym/_emerge/help.py | 8 ++++++++
pym/_emerge/main.py | 10 ++++++++++
4 files changed, 53 insertions(+), 16 deletions(-)
diff --git a/man/emerge.1 b/man/emerge.1
index aa85a7b..d6d74e0 100644
--- a/man/emerge.1
+++ b/man/emerge.1
@@ -304,6 +304,11 @@ 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\-unrestricted\-atoms [ y | n ]"
+If \-\-autounmask is enabled, changes using the \'=\' operator
+will be written. With this option, \'>=\' operators will be used
+whenever possible.
+.TP
.BR "\-\-autounmask\-write [ y | n ]"
If \-\-autounmask is enabled, changes are written
to config files, respecting \fBCONFIG_PROTECT\fR and \fB\-\-ask\fR.
diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index deda441..a5015b8 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -5728,6 +5728,8 @@ class depgraph(object):
"""
autounmask_write = self._frozen_config.myopts.get("--autounmask-write", "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
@@ -5780,10 +5782,13 @@ class depgraph(object):
keyword = reason.unmask_hint.value
unstable_keyword_msg[root].append(self._get_dep_chain_as_comment(pkg))
- if is_latest:
- unstable_keyword_msg[root].append(">=%s %s\n" % (pkg.cpv, keyword))
- elif is_latest_in_slot:
- unstable_keyword_msg[root].append(">=%s:%s %s\n" % (pkg.cpv, pkg.metadata["SLOT"], keyword))
+ if autounmask_unrestricted_atoms:
+ if is_latest:
+ unstable_keyword_msg[root].append(">=%s %s\n" % (pkg.cpv, keyword))
+ elif is_latest_in_slot:
+ unstable_keyword_msg[root].append(">=%s:%s %s\n" % (pkg.cpv, pkg.metadata["SLOT"], keyword))
+ else:
+ unstable_keyword_msg[root].append("=%s %s\n" % (pkg.cpv, keyword))
else:
unstable_keyword_msg[root].append("=%s %s\n" % (pkg.cpv, keyword))
@@ -5817,10 +5822,13 @@ class depgraph(object):
comment.splitlines() if line]
for line in comment:
p_mask_change_msg[root].append("%s\n" % line)
- if is_latest:
- p_mask_change_msg[root].append(">=%s\n" % pkg.cpv)
- elif is_latest_in_slot:
- p_mask_change_msg[root].append(">=%s:%s\n" % (pkg.cpv, pkg.metadata["SLOT"]))
+ if autounmask_unrestricted_atoms:
+ if is_latest:
+ p_mask_change_msg[root].append(">=%s\n" % pkg.cpv)
+ elif is_latest_in_slot:
+ p_mask_change_msg[root].append(">=%s:%s\n" % (pkg.cpv, pkg.metadata["SLOT"]))
+ else:
+ p_mask_change_msg[root].append("=%s\n" % pkg.cpv)
else:
p_mask_change_msg[root].append("=%s\n" % pkg.cpv)
@@ -5840,10 +5848,13 @@ class depgraph(object):
else:
adjustments.append("-" + flag)
use_changes_msg[root].append(self._get_dep_chain_as_comment(pkg, unsatisfied_dependency=True))
- if is_latest:
- use_changes_msg[root].append(">=%s %s\n" % (pkg.cpv, " ".join(adjustments)))
- elif is_latest_in_slot:
- use_changes_msg[root].append(">=%s:%s %s\n" % (pkg.cpv, pkg.metadata["SLOT"], " ".join(adjustments)))
+ if autounmask_unrestricted_atoms:
+ if is_latest:
+ use_changes_msg[root].append(">=%s %s\n" % (pkg.cpv, " ".join(adjustments)))
+ elif is_latest_in_slot:
+ use_changes_msg[root].append(">=%s:%s %s\n" % (pkg.cpv, pkg.metadata["SLOT"], " ".join(adjustments)))
+ else:
+ use_changes_msg[root].append("=%s %s\n" % (pkg.cpv, " ".join(adjustments)))
else:
use_changes_msg[root].append("=%s %s\n" % (pkg.cpv, " ".join(adjustments)))
@@ -5857,10 +5868,13 @@ class depgraph(object):
is_latest, is_latest_in_slot = check_if_latest(pkg)
license_msg[root].append(self._get_dep_chain_as_comment(pkg))
- if is_latest:
- license_msg[root].append(">=%s %s\n" % (pkg.cpv, " ".join(sorted(missing_licenses))))
- elif is_latest_in_slot:
- license_msg[root].append(">=%s:%s %s\n" % (pkg.cpv, pkg.metadata["SLOT"], " ".join(sorted(missing_licenses))))
+ if autounmask_unrestricted_atoms:
+ if is_latest:
+ license_msg[root].append(">=%s %s\n" % (pkg.cpv, " ".join(sorted(missing_licenses))))
+ elif is_latest_in_slot:
+ license_msg[root].append(">=%s:%s %s\n" % (pkg.cpv, pkg.metadata["SLOT"], " ".join(sorted(missing_licenses))))
+ else:
+ license_msg[root].append("=%s %s\n" % (pkg.cpv, " ".join(sorted(missing_licenses))))
else:
license_msg[root].append("=%s %s\n" % (pkg.cpv, " ".join(sorted(missing_licenses))))
diff --git a/pym/_emerge/help.py b/pym/_emerge/help.py
index 1e62ccf..f5ff7a3 100644
--- a/pym/_emerge/help.py
+++ b/pym/_emerge/help.py
@@ -323,6 +323,14 @@ def help(myopts, havecolor=1):
for line in wrap(desc, desc_width):
print(desc_indent + line)
print()
+ print(" " + green("--autounmask-unrestricted-atoms") + " [ %s | %s ]" % \
+ (turquoise("y"), turquoise("n")))
+ desc = "If --autounmask is enabled, changes using the '=' operator " + \
+ "will be written. With this option, '>=' operators will be used " + \
+ "whenever possible."
+ for line in wrap(desc, desc_width):
+ print(desc_indent + line)
+ print()
print(" " + green("--autounmask-write") + " [ %s | %s ]" % \
(turquoise("y"), turquoise("n")))
desc = "If --autounmask is enabled, changes are written " + \
diff --git a/pym/_emerge/main.py b/pym/_emerge/main.py
index b6b63e2..73d0795 100644
--- a/pym/_emerge/main.py
+++ b/pym/_emerge/main.py
@@ -431,6 +431,7 @@ def insert_optional_args(args):
default_arg_opts = {
'--ask' : y_or_n,
'--autounmask' : y_or_n,
+ '--autounmask-unrestricted-atoms' : y_or_n,
'--autounmask-write' : y_or_n,
'--buildpkg' : y_or_n,
'--complete-graph' : y_or_n,
@@ -603,6 +604,12 @@ def parse_opts(tmpcmdline, silent=False):
"choices" : true_y_or_n
},
+ "--autounmask-unrestricted-atoms": {
+ "help" : "write autounmask changes with >= atoms if possible",
+ "type" : "choice",
+ "choices" : true_y_or_n
+ },
+
"--autounmask-write": {
"help" : "write changes made by --autounmask to disk",
"type" : "choice",
@@ -926,6 +933,9 @@ def parse_opts(tmpcmdline, silent=False):
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_write in true_y:
myoptions.autounmask_write = True
next reply other threads:[~2011-09-19 14:16 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-19 14:15 Zac Medico [this message]
-- strict thread matches above, loose matches on Subject: below --
2018-02-03 3:07 [gentoo-commits] proj/portage:master commit in: man/, pym/_emerge/ Zac Medico
2018-01-30 4:24 Zac Medico
2017-05-14 18:12 Zac Medico
2016-08-08 15:56 Zac Medico
2014-12-07 23:14 Zac Medico
2014-10-21 23:11 Zac Medico
2014-10-20 0:08 Zac Medico
2014-09-24 22:36 Brian Dolbec
2014-06-14 21:46 Alexander Berntsen
2014-06-14 21:46 Alexander Berntsen
2014-06-14 20:58 Alexander Berntsen
2013-07-18 20:25 Zac Medico
2013-07-18 20:23 Zac Medico
2013-02-23 19:17 Zac Medico
2012-12-29 22:35 Zac Medico
2012-12-08 9:25 Zac Medico
2012-11-29 7:53 Zac Medico
2012-10-08 20:30 Zac Medico
2011-12-14 4:47 Zac Medico
2011-10-16 18:58 Zac Medico
2011-10-10 18:05 Zac Medico
2011-09-21 14:00 Zac Medico
2011-09-19 16:03 Zac Medico
2011-09-18 20:16 Zac Medico
2011-07-19 8:38 Zac Medico
2011-06-04 23:32 Zac Medico
2011-06-03 5:40 Zac Medico
2011-05-17 4:31 Zac Medico
2011-05-15 19:20 Zac Medico
2011-05-11 19:04 Zac Medico
2011-04-28 16:16 Zac Medico
2011-04-27 22:07 Zac Medico
2011-04-27 22:03 Zac Medico
2011-04-27 22:00 Zac Medico
2011-03-24 18:18 Zac Medico
2011-03-14 17:52 Zac Medico
2011-02-13 0:24 Zac Medico
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=7e956a6ec65b9b48a9fca3e928e7c7b56fd066b6.zmedico@gentoo \
--to=zmedico@gentoo.org \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-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