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/_parallel_manifest/
Date: Thu, 18 Oct 2012 01:43:46 +0000 (UTC)	[thread overview]
Message-ID: <1350524607.4ec3c49862c9b3cf0ccd7bd2d8112faf36bb04f0.zmedico@gentoo> (raw)

commit:     4ec3c49862c9b3cf0ccd7bd2d8112faf36bb04f0
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Oct 18 01:43:27 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Oct 18 01:43:27 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=4ec3c498

ManifestTask: stricter gpg key comparison

Use normalization and == comparison instead of the "in" operator.

---
 .../ebuild/_parallel_manifest/ManifestTask.py      |   15 ++++++++++++++-
 1 files changed, 14 insertions(+), 1 deletions(-)

diff --git a/pym/portage/package/ebuild/_parallel_manifest/ManifestTask.py b/pym/portage/package/ebuild/_parallel_manifest/ManifestTask.py
index e155bc9..d923088 100644
--- a/pym/portage/package/ebuild/_parallel_manifest/ManifestTask.py
+++ b/pym/portage/package/ebuild/_parallel_manifest/ManifestTask.py
@@ -82,13 +82,26 @@ class ManifestTask(CompositeTask):
 				return m.group(0)
 		return None
 
+	@staticmethod
+	def _normalize_gpg_key(key_str):
+		"""
+		Strips leading "0x" and trailing "!", and converts to uppercase
+		(intended to be the same format as that in gpg --verify output).
+		"""
+		key_str = key_str.upper()
+		if key_str.startswith("0X"):
+			key_str = key_str[2:]
+		key_str = key_str.rstrip("!")
+		return key_str
+
 	def _check_sig_key_exit(self, proc):
 		self._assert_current(proc)
 
 		parsed_key = self._parse_gpg_key(
 			proc.pipe_reader.getvalue().decode('utf_8', 'replace'))
 		if parsed_key is not None and \
-			parsed_key.lower() in self.force_sign_key.lower():
+			self._normalize_gpg_key(parsed_key) == \
+			self._normalize_gpg_key(self.force_sign_key):
 			self.returncode = os.EX_OK
 			self._current_task = None
 			self.wait()


             reply	other threads:[~2012-10-18  1:43 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-18  1:43 Zac Medico [this message]
  -- strict thread matches above, loose matches on Subject: below --
2013-01-08  1:48 [gentoo-commits] proj/portage:master commit in: pym/portage/package/ebuild/_parallel_manifest/ Zac Medico
2013-01-06 11:06 Zac Medico
2012-10-18  6:37 Zac Medico
2012-10-18  1:24 Zac Medico
2012-10-17  2:01 Zac Medico
2012-10-16 22:45 Zac Medico
2012-10-06 17:26 Zac Medico
2012-10-03 23:32 Zac Medico
2012-10-03 20:21 Zac Medico
2012-10-03 20:16 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=1350524607.4ec3c49862c9b3cf0ccd7bd2d8112faf36bb04f0.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