summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Meyer <nickaristocrates@gmail.com>2020-11-01 00:35:59 -0700
committerJoonas Niilola <juippis@gentoo.org>2020-11-01 10:18:19 +0200
commit18a61400006e1ce80ef444e462a26fdc079857a0 (patch)
tree22a3e7a18c6d876ea04189d5c81444e0283c4e2c
parentapp-emulation/firecracker-bin: Bump to 0.23.0 (diff)
downloadgentoo-18a61400006e1ce80ef444e462a26fdc079857a0.tar.gz
gentoo-18a61400006e1ce80ef444e462a26fdc079857a0.tar.bz2
gentoo-18a61400006e1ce80ef444e462a26fdc079857a0.zip
app-crypt/pius: pull in minor fixes from upstream
Closes: https://bugs.gentoo.org/752084 Signed-off-by: Nicholas Meyer <nickaristocrates@gmail.com> Signed-off-by: Joonas Niilola <juippis@gentoo.org>
-rw-r--r--app-crypt/pius/files/pius-3.0.0_fix_keyring_mgr_constants.diff40
-rw-r--r--app-crypt/pius/files/pius-3.0.0_fix_pius_report.diff63
-rw-r--r--app-crypt/pius/files/pius-3.0.0_fix_readme_typo.diff13
-rw-r--r--app-crypt/pius/files/pius-3.0.0_fix_typos.diff31
-rw-r--r--app-crypt/pius/pius-3.0.0-r1.ebuild (renamed from app-crypt/pius/pius-3.0.0.ebuild)7
5 files changed, 154 insertions, 0 deletions
diff --git a/app-crypt/pius/files/pius-3.0.0_fix_keyring_mgr_constants.diff b/app-crypt/pius/files/pius-3.0.0_fix_keyring_mgr_constants.diff
new file mode 100644
index 000000000000..9871a51e6ede
--- /dev/null
+++ b/app-crypt/pius/files/pius-3.0.0_fix_keyring_mgr_constants.diff
@@ -0,0 +1,40 @@
+diff --git a/pius-keyring-mgr b/pius-keyring-mgr
+index 1daddeb..fb0b46a 100755
+--- a/pius-keyring-mgr
++++ b/pius-keyring-mgr
+@@ -28,6 +28,8 @@ from libpius.constants import (
+ GPG_BASE_OPTS,
+ GPG_QUIET_OPTS,
+ GPG_FD_OPTS,
++ FP_RE,
++ FIXFP_RE,
+ )
+
+ BADKEYS_RE = re.compile(r"00000000|12345678|no pgp key")
+@@ -143,10 +145,10 @@ class PiusParser:
+ def parse_flatfile(self, filename):
+ with open(filename, "r") as fd:
+ contents = fd.read()
+- matches = self.FP_RE.findall(contents)
++ matches = FP_RE.findall(contents)
+ keys = []
+ for match in matches:
+- flatfp = self.FIXFP_RE.sub("", match)
++ flatfp = FIXFP_RE.sub("", match)
+ keyid = flatfp[-8:]
+ keys.append(
+ {
+@@ -199,11 +201,11 @@ class PiusParser:
+ tmp["key"] = match
+ keys.append(tmp)
+ continue
+- matches = self.FP_RE.findall(decoded)
++ matches = FP_RE.findall(decoded)
+ if matches:
+ for match in matches:
+ num_fps = num_fps + 1
+- fp = self.FIXFP_RE.sub("", match)
++ fp = FIXFP_RE.sub("", match)
+ keyid = keyid_from_fp(fp)
+ tmp = data.copy()
+ tmp.update({"fingerprint": fp, "keyid": keyid})
diff --git a/app-crypt/pius/files/pius-3.0.0_fix_pius_report.diff b/app-crypt/pius/files/pius-3.0.0_fix_pius_report.diff
new file mode 100644
index 000000000000..40bb969aab7b
--- /dev/null
+++ b/app-crypt/pius/files/pius-3.0.0_fix_pius_report.diff
@@ -0,0 +1,63 @@
+diff --git a/libpius/mailer.py b/libpius/mailer.py
+index ba6b50a..f5b097f 100644
+--- a/libpius/mailer.py
++++ b/libpius/mailer.py
+@@ -403,7 +403,7 @@ class PiusMailer:
+ # BCC the user...
+ env_to = [msg["To"], self.mail]
+
+- smtp.sendmail(self.mail, env_to, msg.as_string())
++ smtp.sendmail(self.mail, env_to, msg.as_string().encode('utf-8'))
+ smtp.quit()
+ except smtplib.SMTPException as emsg:
+ raise MailSendError(emsg)
+diff --git a/pius-keyring-mgr b/pius-keyring-mgr
+index fb0b46a..ec3528a 100755
+--- a/pius-keyring-mgr
++++ b/pius-keyring-mgr
+@@ -1,4 +1,5 @@
+ #!/usr/bin/env python3
++
+ """A utility to create and manage party keyrings."""
+
+ # vim:tw=80:ai:tabstop=4:expandtab:shiftwidth=4
+@@ -446,7 +447,7 @@ class KeyringBuilder:
+ # stolen from pius
+ def get_all_keyids(self, sort_keyring):
+ """Given a keyring, get all the KeyIDs from it."""
+- util.debug("extracting all keyids from keyring")
++ util.debug("extracting all keyids from keyring, sort: %s" % sort_keyring)
+ extra_opts = GPG_QUIET_OPTS + self.AUTO_OPTS + ["--fixed-list-mode"]
+ cmd = self.basecmd + extra_opts + ["--fingerprint"]
+ util.logcmd(cmd)
+@@ -776,6 +777,7 @@ before distributing they keyring.
+ prune.add_option(
+ "--no-sort-keyring",
+ dest="sort_keyring",
++ default=True,
+ action="store_false",
+ help="Do not sort the keyring by name.",
+ )
+diff --git a/pius-report b/pius-report
+index 47f57b5..744da35 100755
+--- a/pius-report
++++ b/pius-report
+@@ -15,7 +15,8 @@ from optparse import OptionParser
+ from libpius import mailer as pmailer
+ from libpius import signer as psigner
+ from libpius.util import PiusUtil, MyOption
+-from libpius.constants import DEFAULT_GPG_PATH, UID_RE, GPG_MIN_OPTS
++from libpius.constants import DEFAULT_GPG_PATH, UID_RE, GPG_MIN_OPTS, \
++ GPG_BASE_OPTS
+ from libpius.exceptions import MailSendError
+ from libpius.state import SignState
+
+@@ -401,7 +402,7 @@ Generated by PIUS Report BETA (http://www.phildev.net/pius/).
+
+ def refresh_keys(gpg, keys):
+ cmd = [gpg] + GPG_MIN_OPTS + ["--refresh-keys"] + keys
+- PiusPiusUtil.logcmd(cmd)
++ PiusUtil.logcmd(cmd)
+ gpg = subprocess.Popen(cmd, stdout=subprocess.PIPE, close_fds=True)
+ gpg.wait()
+
diff --git a/app-crypt/pius/files/pius-3.0.0_fix_readme_typo.diff b/app-crypt/pius/files/pius-3.0.0_fix_readme_typo.diff
new file mode 100644
index 000000000000..c51880aed3bd
--- /dev/null
+++ b/app-crypt/pius/files/pius-3.0.0_fix_readme_typo.diff
@@ -0,0 +1,13 @@
+diff --git a/README.md b/README.md
+index 3ead858..4cb98ce 100644
+--- a/README.md
++++ b/README.md
+@@ -91,7 +91,7 @@ docs](https://support.google.com/accounts/answer/185833?hl=en).
+ ## Other Platforms
+
+ On non-UNIX platforms such as MacOS and Windows, the default gpg path will
+-likley be incorrect, so you'll want to use `-b` to specify the path.
++likely be incorrect, so you'll want to use `-b` to specify the path.
+
+
+ ## Config File
diff --git a/app-crypt/pius/files/pius-3.0.0_fix_typos.diff b/app-crypt/pius/files/pius-3.0.0_fix_typos.diff
new file mode 100644
index 000000000000..1620d02b8e0c
--- /dev/null
+++ b/app-crypt/pius/files/pius-3.0.0_fix_typos.diff
@@ -0,0 +1,31 @@
+diff --git a/pius b/pius
+index 7cf09b5..cc2333b 100755
+--- a/pius
++++ b/pius
+@@ -25,7 +25,7 @@ from optparse import OptionParser
+
+ from libpius import mailer as pmailer
+ from libpius import signer as psigner
+-from libpius.util import PiusUtil, MyOption
++from libpius.util import PiusUtil, MyOption, check_email
+ from libpius.constants import (
+ DEFAULT_GPG_PATH,
+ DEFAULT_KEYRING,
+@@ -61,7 +61,7 @@ def check_options(parser, options, args):
+
+ if options.debug == True:
+ print("Setting debug")
+- util.DEBUG_ON = True
++ PiusUtil.DEBUG_ON = True
+
+ if not os.path.exists(options.gpg_path):
+ parser.error("GnuPG binary not found at %s." % options.gpg_path)
+@@ -288,7 +288,7 @@ def main():
+ )
+ if ans in ("y", "Y", "yes", "YES", "Yes"):
+ ans = input("What email address should we send from? ")
+- util.check_email(parser, "-m", ans)
++ check_email(parser, "-m", ans)
+ options.mail = ans
+ print()
+
diff --git a/app-crypt/pius/pius-3.0.0.ebuild b/app-crypt/pius/pius-3.0.0-r1.ebuild
index f7f3745afd4d..105bf866e5e7 100644
--- a/app-crypt/pius/pius-3.0.0.ebuild
+++ b/app-crypt/pius/pius-3.0.0-r1.ebuild
@@ -22,6 +22,13 @@ DEPEND=">=app-crypt/gnupg-2.0.0"
RDEPEND="${DEPEND}
dev-lang/perl"
+PATCHES=(
+ "${FILESDIR}/${P}_fix_typos.diff"
+ "${FILESDIR}/${P}_fix_keyring_mgr_constants.diff"
+ "${FILESDIR}/${P}_fix_readme_typo.diff"
+ "${FILESDIR}/${P}_fix_pius_report.diff"
+)
+
python_test() {
${EPYTHON} -m unittest discover -s test/* -v || die
}