summaryrefslogtreecommitdiff
path: root/dev-vcs/pwclient
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2018-07-14 21:03:06 +0100
committerV3n3RiX <venerix@redcorelinux.org>2018-07-14 21:03:06 +0100
commit8376ef56580626e9c0f796d5b85b53a0a1c7d5f5 (patch)
tree7681bbd4e8b05407772df40a4bf04cbbc8afc3fa /dev-vcs/pwclient
parent30a9caf154332f12ca60756e1b75d2f0e3e1822d (diff)
gentoo resync : 14.07.2018
Diffstat (limited to 'dev-vcs/pwclient')
-rw-r--r--dev-vcs/pwclient/Manifest6
-rw-r--r--dev-vcs/pwclient/files/pwclient-20141110122616-0001-pwclient-handle-missing-.pwclientrc-better.patch45
-rw-r--r--dev-vcs/pwclient/files/pwclient-20141110122616-0002-pwclient-use-print_function-for-better-py3-compatibi.patch101
-rw-r--r--dev-vcs/pwclient/files/pwclient-20141110122616-0003-pwclient-basic-python3-support.patch125
-rw-r--r--dev-vcs/pwclient/metadata.xml5
-rw-r--r--dev-vcs/pwclient/pwclient-20141110122616.ebuild44
6 files changed, 326 insertions, 0 deletions
diff --git a/dev-vcs/pwclient/Manifest b/dev-vcs/pwclient/Manifest
new file mode 100644
index 000000000000..db851e8fe7c0
--- /dev/null
+++ b/dev-vcs/pwclient/Manifest
@@ -0,0 +1,6 @@
+AUX pwclient-20141110122616-0001-pwclient-handle-missing-.pwclientrc-better.patch 1812 BLAKE2B dc3adab92d7aea4666d827a21eabbe2889c12a166559bafa5ab53f71ca2b019dfa16d859c67b89c38155eda0ae327d538d0a7b977e092011c7fc2348862364e1 SHA512 8d712a184d8dceb5eeb69596a65072f6b23ec998f78878b795574464aed1811764d7cb35ea50a36f0f1d8cb0cddb4ed2fb0fe9532b55a4d4992df648fbf2b974
+AUX pwclient-20141110122616-0002-pwclient-use-print_function-for-better-py3-compatibi.patch 4005 BLAKE2B c591d837988f4d5f698ad9c723b77491ed547bb017f4382549b450856eaf570579ca3e1d8ac7506bac13282fd0527e177851171145104a3361a44664bc2c9ab8 SHA512 6bd87392b99a6339f71ab0ed47115a63a5ed43c0d3c1b8b56e2fdfd77ebb8f8692ae3074c6e858f44b1de5d9bd439042b9d50fa38c90712b62d524e4cfcb8ba3
+AUX pwclient-20141110122616-0003-pwclient-basic-python3-support.patch 4223 BLAKE2B d4709dd5a2f18647e646cc285a52bad1aaab7637f9b96dc528cac429b39253f0f7c9361cf81f851edfc68337f3805a80f8ceb4bc63098a037aa7a70bdaddf3c5 SHA512 be178e4f303ff777ed870a029561802e2294a53feed1e9bbf546b0947cc1ae0ca5ede44c6e73018c1a3370e3df388f5dc921459d9f0730f1152078ff439acaab
+DIST pwclient-20141110122616 23527 BLAKE2B 61a49c6104db0015d0cf9ea4fddefe3ccde6495d0a0caf918d858e535bbbd085ee5a80f856753ea547b1ac18fb22344036734a5814d06865bde2622368b88155 SHA512 4933b7c5b4129d5fa1e47fa09dd8a75e5e5aac3254d8ed4bb65f8e7363d082217deecf8fc99f53092b607c49eebf9144e335079472a790a0193d0c6cddcf433f
+EBUILD pwclient-20141110122616.ebuild 1053 BLAKE2B 92d1e35e6551828c250c973de5e91ebd429ab1483be8d1fe9c4c1fd28d15407448eb95d76a2c63637c357234e11bfd68107583e197a02f2e58045824b9d419bf SHA512 84d3287c8dfc3bd0c408b09a0cce78db126fd123dad760e6cd7f7837ab282367d1635a7d447f1d18ecb49676181e213f15c96a4acb1912f6f82d84ec1a3e975e
+MISC metadata.xml 166 BLAKE2B c254f1fb642881aba57637be14fb0a89b10384f91a128feaec3a8c870d76efc2cbacb92caccc0dee2dd19a5ac5eaf8643080dafa05c4e2ac96a68568927e5afd SHA512 a56648c974a1d14dd4c18237532773c72057a13ab90c58b5da04f185e3c12a8bd8d5c21fb06053507f31766291a82dc7d87b34cd65fd94cfe2af7295c813ef84
diff --git a/dev-vcs/pwclient/files/pwclient-20141110122616-0001-pwclient-handle-missing-.pwclientrc-better.patch b/dev-vcs/pwclient/files/pwclient-20141110122616-0001-pwclient-handle-missing-.pwclientrc-better.patch
new file mode 100644
index 000000000000..43e2606efa67
--- /dev/null
+++ b/dev-vcs/pwclient/files/pwclient-20141110122616-0001-pwclient-handle-missing-.pwclientrc-better.patch
@@ -0,0 +1,45 @@
+From 601e1362d63293ca567295f63cb52bcfeb5d9959 Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@chromium.org>
+Date: Tue, 5 May 2015 23:19:57 -0400
+Subject: [PATCH 1/3] pwclient: handle missing ~/.pwclientrc better
+
+The upgrade path will crash if ~/.pwclientrc doesn't exist, so add an
+explicit check for the file before we try to "upgrade" it.
+
+The default error messages don't mention the config file, so it can be
+a bit confusing what pwclient is complaining about when running.
+
+Signed-off-by: Mike Frysinger <vapier@chromium.org>
+---
+ apps/patchwork/bin/pwclient | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/apps/patchwork/bin/pwclient b/apps/patchwork/bin/pwclient
+index 2a80981..56aa909 100755
+--- a/apps/patchwork/bin/pwclient
++++ b/apps/patchwork/bin/pwclient
+@@ -552,7 +552,7 @@ def main():
+ config = ConfigParser.ConfigParser()
+ config.read([CONFIG_FILE])
+
+- if not config.has_section('options'):
++ if not config.has_section('options') and os.path.exists(CONFIG_FILE):
+ sys.stderr.write('~/.pwclientrc is in the old format. Migrating it...')
+
+ old_project = config.get('base','project')
+@@ -590,10 +590,10 @@ def main():
+ sys.exit(1)
+
+ if not config.has_section(project_str):
+- sys.stderr.write("No section for project %s\n" % project_str)
++ sys.stderr.write('No section for project %s in ~/.pwclientrc\n' % project_str)
+ sys.exit(1)
+ if not config.has_option(project_str, 'url'):
+- sys.stderr.write("No URL for project %s\n" % project_str)
++ sys.stderr.write('No URL for project %s in ~/.pwclientrc\n' % project_str)
+ sys.exit(1)
+ if not do_signoff and config.has_option('options', 'signoff'):
+ do_signoff = config.getboolean('options', 'signoff')
+--
+2.4.0
+
diff --git a/dev-vcs/pwclient/files/pwclient-20141110122616-0002-pwclient-use-print_function-for-better-py3-compatibi.patch b/dev-vcs/pwclient/files/pwclient-20141110122616-0002-pwclient-use-print_function-for-better-py3-compatibi.patch
new file mode 100644
index 000000000000..70f54a7aed3a
--- /dev/null
+++ b/dev-vcs/pwclient/files/pwclient-20141110122616-0002-pwclient-use-print_function-for-better-py3-compatibi.patch
@@ -0,0 +1,101 @@
+From 0991ccb0e7c0be66e087839f88a7120394c2f052 Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@chromium.org>
+Date: Tue, 5 May 2015 23:54:16 -0400
+Subject: [PATCH 2/3] pwclient: use print_function for better py3 compatibility
+
+The script already tries to use print like a function in many places but
+is really passing a parenthesized string. Import the print_function from
+the future module so that it actually works as intended.
+
+We also need to fix up a few latent print statements to make it work.
+
+Signed-off-by: Mike Frysinger <vapier@chromium.org>
+---
+ apps/patchwork/bin/pwclient | 26 ++++++++++++++------------
+ 1 file changed, 14 insertions(+), 12 deletions(-)
+
+diff --git a/apps/patchwork/bin/pwclient b/apps/patchwork/bin/pwclient
+index 56aa909..2e6daa5 100755
+--- a/apps/patchwork/bin/pwclient
++++ b/apps/patchwork/bin/pwclient
+@@ -19,6 +19,8 @@
+ # along with Patchwork; if not, write to the Free Software
+ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
++from __future__ import print_function
++
+ import os
+ import sys
+ import xmlrpclib
+@@ -170,9 +172,9 @@ def action_list(rpc, filter, submitter_str, delegate_str, format_str=None):
+ else:
+ for id in ids:
+ person = rpc.person_get(id)
+- print "Patches submitted by %s <%s>:" % \
+- (unicode(person['name']).encode("utf-8"), \
+- unicode(person['email']).encode("utf-8"))
++ print('Patches submitted by %s <%s>:' %
++ (unicode(person['name']).encode('utf-8'),
++ unicode(person['email']).encode('utf-8')))
+ f = filter
+ f.add("submitter_id", id)
+ patches = rpc.patch_list(f.d)
+@@ -187,8 +189,8 @@ def action_list(rpc, filter, submitter_str, delegate_str, format_str=None):
+ else:
+ for id in ids:
+ person = rpc.person_get(id)
+- print "Patches delegated to %s <%s>:" % \
+- (person['name'], person['email'])
++ print('Patches delegated to %s <%s>:' %
++ (person['name'], person['email']))
+ f = filter
+ f.add("delegate_id", id)
+ patches = rpc.patch_list(f.d)
+@@ -245,7 +247,7 @@ def action_get(rpc, patch_id):
+ try:
+ f.write(unicode(s).encode("utf-8"))
+ f.close()
+- print "Saved patch to %s" % fname
++ print('Saved patch to %s' % fname)
+ except:
+ sys.stderr.write("Failed to write to %s\n" % fname)
+ sys.exit(1)
+@@ -258,13 +260,13 @@ def action_apply(rpc, patch_id, apply_cmd=None):
+ sys.exit(1)
+
+ if apply_cmd is None:
+- print "Applying patch #%d to current directory" % patch_id
++ print('Applying patch #%d to current directory' % patch_id)
+ apply_cmd = ['patch', '-p1']
+ else:
+- print "Applying patch #%d using %s" % (
+- patch_id, repr(' '.join(apply_cmd)))
++ print('Applying patch #%d using %s' %
++ (patch_id, repr(' '.join(apply_cmd))))
+
+- print "Description: %s" % patch['name']
++ print('Description: %s' % patch['name'])
+ s = rpc.patch_get_mbox(patch_id)
+ if len(s) > 0:
+ proc = subprocess.Popen(apply_cmd, stdin = subprocess.PIPE)
+@@ -295,7 +297,7 @@ def action_update_patch(rpc, patch_id, state = None, commit = None):
+ success = False
+ try:
+ success = rpc.patch_set(patch_id, params)
+- except xmlrpclib.Fault, f:
++ except xmlrpclib.Fault as f:
+ sys.stderr.write("Error updating patch: %s\n" % f.faultString)
+
+ if not success:
+@@ -668,7 +670,7 @@ def main():
+ for patch_id in non_empty(h, patch_ids):
+ s = rpc.patch_get_mbox(patch_id)
+ if len(s) > 0:
+- print unicode(s).encode("utf-8")
++ print(unicode(s).encode('utf-8'))
+
+ elif action == 'info':
+ for patch_id in non_empty(h, patch_ids):
+--
+2.4.0
+
diff --git a/dev-vcs/pwclient/files/pwclient-20141110122616-0003-pwclient-basic-python3-support.patch b/dev-vcs/pwclient/files/pwclient-20141110122616-0003-pwclient-basic-python3-support.patch
new file mode 100644
index 000000000000..da75ac1d3e1a
--- /dev/null
+++ b/dev-vcs/pwclient/files/pwclient-20141110122616-0003-pwclient-basic-python3-support.patch
@@ -0,0 +1,125 @@
+From fcbd40fe7fa3fbdc5ffb386c5c7b72a8704e7136 Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@chromium.org>
+Date: Wed, 6 May 2015 00:12:02 -0400
+Subject: [PATCH 3/3] pwclient: basic python3 support
+
+This fixes a few random issues to make the script work at least somewhat
+under python 3:
+- set the default encoding to utf-8
+- handle xmlrpclib/xmlrpc.client module renames
+- handle ConfigParser/configparser module renames
+- add a unicode() stub for python 3
+- fix old style class definition w/Filter
+- use list comprehension instead of map()
+- drop the unused version= keyword w/argparse
+
+The code still runs under python 2 the same as before, and now works for
+the most part under python 3 -- the handling of encoded content still needs
+some work, but that'll require more surgery, and is best left to another
+commit after this.
+
+Signed-off-by: Mike Frysinger <vapier@chromium.org>
+---
+ apps/patchwork/bin/pwclient | 31 +++++++++++++++++++++++--------
+ 1 file changed, 23 insertions(+), 8 deletions(-)
+
+diff --git a/apps/patchwork/bin/pwclient b/apps/patchwork/bin/pwclient
+index 2e6daa5..5080a17 100755
+--- a/apps/patchwork/bin/pwclient
++++ b/apps/patchwork/bin/pwclient
+@@ -1,4 +1,5 @@
+ #!/usr/bin/env python
++# -*- coding: utf-8 -*-
+ #
+ # Patchwork command line client
+ # Copyright (C) 2008 Nate Case <ncase@xes-inc.com>
+@@ -23,16 +24,31 @@ from __future__ import print_function
+
+ import os
+ import sys
+-import xmlrpclib
++try:
++ import xmlrpclib
++except ImportError:
++ # Python 3 has merged/renamed things.
++ import xmlrpc.client as xmlrpclib
+ import argparse
+ import string
+ import tempfile
+ import subprocess
+ import base64
+-import ConfigParser
++try:
++ import ConfigParser
++except ImportError:
++ # Python 3 has renamed things.
++ import configparser as ConfigParser
+ import shutil
+ import re
+
++# Add a shim for Python 2's unicode() helper.
++try:
++ unicode
++except NameError:
++ # Python 3 does everything by unicode now.
++ unicode = str
++
+ # Default Patchwork remote XML-RPC server URL
+ # This script will check the PW_XMLRPC_URL environment variable
+ # for the URL to access. If that is unspecified, it will fallback to
+@@ -40,7 +56,7 @@ import re
+ DEFAULT_URL = "http://patchwork/xmlrpc/"
+ CONFIG_FILE = os.path.expanduser('~/.pwclientrc')
+
+-class Filter:
++class Filter(object):
+ """Filter for selecting patches."""
+ def __init__(self):
+ # These fields refer to specific objects, so they are special
+@@ -135,7 +151,7 @@ def person_ids_by_name(rpc, name):
+ if len(name) == 0:
+ return []
+ people = rpc.person_list(name, 0)
+- return map(lambda x: x['id'], people)
++ return [x['id'] for x in people]
+
+ def list_patches(patches, format_str=None):
+ """Dump a list of patches to stdout."""
+@@ -352,7 +368,7 @@ class _RecursiveHelpAction(argparse._HelpAction):
+ parser.exit()
+
+ def main():
+- hash_parser = argparse.ArgumentParser(add_help=False, version=False)
++ hash_parser = argparse.ArgumentParser(add_help=False)
+ hash_parser.add_argument(
+ '-h', metavar='HASH', dest='hash', action='store',
+ help='''Lookup by patch hash'''
+@@ -362,7 +378,7 @@ def main():
+ help='Patch ID',
+ )
+
+- filter_parser = argparse.ArgumentParser(add_help=False, version=False)
++ filter_parser = argparse.ArgumentParser(add_help=False)
+ filter_parser.add_argument(
+ '-s', metavar='STATE',
+ help='''Filter by patch state (e.g., 'New', 'Accepted', etc.)'''
+@@ -397,7 +413,7 @@ def main():
+ 'patch_name', metavar='STR', nargs='?',
+ help='substring to search for patches by name',
+ )
+- help_parser = argparse.ArgumentParser(add_help=False, version=False)
++ help_parser = argparse.ArgumentParser(add_help=False)
+ help_parser.add_argument(
+ '--help', action='help', help=argparse.SUPPRESS,
+ #help='''show this help message and exit'''
+@@ -406,7 +422,6 @@ def main():
+ action_parser = argparse.ArgumentParser(
+ prog='pwclient',
+ add_help=False,
+- version=False,
+ formatter_class=argparse.RawDescriptionHelpFormatter,
+ epilog='''(apply | get | info | view | update) (-h HASH | ID [ID ...])''',
+ )
+--
+2.4.0
+
diff --git a/dev-vcs/pwclient/metadata.xml b/dev-vcs/pwclient/metadata.xml
new file mode 100644
index 000000000000..6f49eba8f496
--- /dev/null
+++ b/dev-vcs/pwclient/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<!-- maintainer-needed -->
+</pkgmetadata>
diff --git a/dev-vcs/pwclient/pwclient-20141110122616.ebuild b/dev-vcs/pwclient/pwclient-20141110122616.ebuild
new file mode 100644
index 000000000000..327b429fd3e1
--- /dev/null
+++ b/dev-vcs/pwclient/pwclient-20141110122616.ebuild
@@ -0,0 +1,44 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+PYTHON_COMPAT=( python{2_7,3_4,3_5,3_6} )
+
+inherit eutils python-r1
+
+# The PV comes from:
+# git clone ${EGIT_REPO_URI}
+# cd patchwork
+# EGIT_COMMIT=$(git log -n1 --format=%H apps/patchwork/bin/pwclient)
+# date --date="$(git log -n1 --format=%ci ${EGIT_COMMIT})" -u +%Y%m%d%H%M%S
+EGIT_REPO_URI="git://ozlabs.org/home/jk/git/patchwork"
+EGIT_COMMIT="8904a7dcaf959da8db4a9a5d92b91a61eed05201"
+
+DESCRIPTION="command line utility for interacting with patchwork repos"
+HOMEPAGE="http://jk.ozlabs.org/projects/patchwork/"
+SRC_URI="mirror://gentoo/${P}"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+IUSE=""
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+RDEPEND="${PYTHON_DEPS}"
+DEPEND="${RDEPEND}"
+
+S=${WORKDIR}
+
+src_unpack() {
+ cp "${DISTDIR}"/${P} ${PN} || die
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-*.patch
+}
+
+src_install() {
+ python_setup
+ python_doscript ${PN}
+}