public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Zac Medico" <zmedico@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/portage:master commit in: pym/portage/package/ebuild/_config/
Date: Mon, 10 Oct 2011 01:41:52 +0000 (UTC)	[thread overview]
Message-ID: <c5d2d4c32f0745f30e0cad2e427e79064f93c593.zmedico@gentoo> (raw)

commit:     c5d2d4c32f0745f30e0cad2e427e79064f93c593
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Oct 10 01:40:32 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Oct 10 01:40:32 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=c5d2d4c3

MaskManager: fix "Unmatched removal", bug #386569

---
 pym/portage/package/ebuild/_config/MaskManager.py |   45 ++++++++++++++++++--
 1 files changed, 40 insertions(+), 5 deletions(-)

diff --git a/pym/portage/package/ebuild/_config/MaskManager.py b/pym/portage/package/ebuild/_config/MaskManager.py
index df93e10..08acf92 100644
--- a/pym/portage/package/ebuild/_config/MaskManager.py
+++ b/pym/portage/package/ebuild/_config/MaskManager.py
@@ -7,7 +7,8 @@ __all__ = (
 
 from portage import os
 from portage.dep import ExtendedAtomDict, match_from_list, _repo_separator, _slot_separator
-from portage.util import append_repo, grabfile_package, stack_lists
+from portage.localization import _
+from portage.util import append_repo, grabfile_package, stack_lists, writemsg
 from portage.versions import cpv_getkey
 from _emerge.Package import Package
 
@@ -43,14 +44,48 @@ class MaskManager(object):
 		for repo in repositories.repos_with_profiles():
 			lines = []
 			repo_lines = grab_pmask(repo.location)
+			removals = frozenset(line[0][1:] for line in repo_lines
+				if line[0][:1] == "-")
+			matched_removals = set()
 			for master in repo.masters:
 				master_lines = grab_pmask(master.location)
+				for line in master_lines:
+					if line[0] in removals:
+						matched_removals.add(line[0])
+				# Since we don't stack masters recursively, there aren't any
+				# atoms earlier in the stack to be matched by negative atoms in
+				# master_lines. Also, repo_lines may contain negative atoms
+				# that are intended to negate atoms from a different master
+				# than the one with which we are currently stacking. Therefore,
+				# we disable warn_for_unmatched_removal here (see bug #386569).
 				lines.append(stack_lists([master_lines, repo_lines], incremental=1,
-					remember_source_file=True, warn_for_unmatched_removal=True,
-					strict_warn_for_unmatched_removal=strict_umatched_removal))
-			if not repo.masters:
+					remember_source_file=True, warn_for_unmatched_removal=False))
+
+			# It's safe to warn for unmatched removal if masters have not
+			# been overridden by the user, which is guaranteed when
+			# user_config is false (when called by repoman).
+			if repo.masters:
+				unmatched_removals = removals.difference(matched_removals)
+				if unmatched_removals and not user_config:
+					source_file = os.path.join(repo.location,
+						"profiles", "package.mask")
+					unmatched_removals = list(unmatched_removals)
+					if len(unmatched_removals) > 3:
+						writemsg(
+							_("--- Unmatched removal atoms in %s: %s and %s more\n") %
+							(source_file,
+							", ".join("-" + x for x in unmatched_removals[:3]),
+							len(unmatched_removals) - 3), noiselevel=-1)
+					else:
+						writemsg(
+							_("--- Unmatched removal atom(s) in %s: %s\n") %
+							(source_file,
+							", ".join("-" + x for x in unmatched_removals)),
+							noiselevel=-1)
+
+			else:
 				lines.append(stack_lists([repo_lines], incremental=1,
-					remember_source_file=True, warn_for_unmatched_removal=True,
+					remember_source_file=True, warn_for_unmatched_removal=not user_config,
 					strict_warn_for_unmatched_removal=strict_umatched_removal))
 			repo_pkgmasklines.extend(append_repo(stack_lists(lines), repo.name, remember_source_file=True))
 



             reply	other threads:[~2011-10-10  1:42 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-10  1:41 Zac Medico [this message]
  -- strict thread matches above, loose matches on Subject: below --
2018-05-03 23:22 [gentoo-commits] proj/portage:master commit in: pym/portage/package/ebuild/_config/ Zac Medico
2018-05-03 20:34 Zac Medico
2017-09-02 17:08 Zac Medico
2017-09-02  9:01 Zac Medico
2017-08-05 20:22 Zac Medico
2015-11-30 23:28 Arfrever Frehtes Taifersar Arahesis
2014-12-13  6:35 Arfrever Frehtes Taifersar Arahesis
2014-11-02 17:54 Zac Medico
2014-10-24 20:39 Zac Medico
2013-10-26 19:31 Arfrever Frehtes Taifersar Arahesis
2013-07-30  5:30 Zac Medico
2013-06-07 20:39 Arfrever Frehtes Taifersar Arahesis
2013-03-12  0:40 Mike Frysinger
2013-01-20  1:30 Zac Medico
2013-01-20  1:28 Zac Medico
2013-01-20  0:44 Zac Medico
2013-01-20  0:12 Zac Medico
2013-01-15 15:03 Zac Medico
2012-10-18  1:03 Zac Medico
2012-09-21  4:31 Arfrever Frehtes Taifersar Arahesis
2012-09-07 20:52 Zac Medico
2012-09-07  0:48 Arfrever Frehtes Taifersar Arahesis
2012-09-06 21:46 Arfrever Frehtes Taifersar Arahesis
2012-08-29 15:51 Zac Medico
2012-08-25 20:40 Zac Medico
2012-04-25 16:41 Zac Medico
2012-04-25 16:38 Zac Medico
2011-12-18 20:15 Zac Medico
2011-10-30  7:16 Zac Medico
2011-10-28  4:55 Zac Medico
2011-10-28  2:48 Zac Medico
2011-10-28  1:45 Zac Medico
2011-10-27 18:49 Zac Medico
2011-10-27 17:24 Zac Medico
2011-10-09 19:10 Zac Medico
2011-10-08 21:41 Arfrever Frehtes Taifersar Arahesis
2011-10-02  2:14 Zac Medico
2011-08-13 12:25 Zac Medico
2011-07-13 17:26 Zac Medico
2011-06-21  1:31 Zac Medico
2011-04-04 22:03 Zac Medico
2011-03-26  1:45 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=c5d2d4c32f0745f30e0cad2e427e79064f93c593.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