[arch-commits] Commit in git/trunk (0001-git-p4-python.patch PKGBUILD)

2020-06-01 Thread Christian Hesse via arch-commits
Date: Monday, June 1, 2020 @ 19:44:53
  Author: eworm
Revision: 388026

upgpkg: git 2.27.0-1

new upstream release

Modified:
  git/trunk/PKGBUILD
Deleted:
  git/trunk/0001-git-p4-python.patch

--+
 0001-git-p4-python.patch |  631 -
 PKGBUILD |   12 
 2 files changed, 2 insertions(+), 641 deletions(-)

Deleted: 0001-git-p4-python.patch
===
--- 0001-git-p4-python.patch2020-06-01 16:08:55 UTC (rev 388025)
+++ 0001-git-p4-python.patch2020-06-01 19:44:53 UTC (rev 388026)
@@ -1,631 +0,0 @@
-diff --git a/git-p4.py b/git-p4.py
-index 40d9e7c594..ca0a874501 100755
 a/git-p4.py
-+++ b/git-p4.py
-@@ -8,12 +8,12 @@
- # License: MIT 
- #
- import sys
--if sys.hexversion < 0x0204:
--# The limiter is the subprocess module
--sys.stderr.write("git-p4: requires Python 2.4 or later.\n")
-+if sys.version_info.major < 3 and sys.version_info.minor < 7:
-+sys.stderr.write("git-p4: requires Python 2.7 or later.\n")
- sys.exit(1)
- import os
- import optparse
-+import functools
- import marshal
- import subprocess
- import tempfile
-@@ -27,36 +27,15 @@
- import ctypes
- import errno
- 
-+# On python2.7 where raw_input() and input() are both availble,
-+# we want raw_input's semantics, but aliased to input for python3
-+# compatibility
- # support basestring in python3
- try:
--unicode = unicode
--except NameError:
--# 'unicode' is undefined, must be Python 3
--str = str
--unicode = str
--bytes = bytes
--basestring = (str,bytes)
--else:
--# 'unicode' exists, must be Python 2
--str = str
--unicode = unicode
--bytes = str
--basestring = basestring
--
--try:
--from subprocess import CalledProcessError
--except ImportError:
--# from python2.7:subprocess.py
--# Exception classes used by this module.
--class CalledProcessError(Exception):
--"""This exception is raised when a process run by check_call() returns
--a non-zero exit status.  The exit status will be stored in the
--returncode attribute."""
--def __init__(self, returncode, cmd):
--self.returncode = returncode
--self.cmd = cmd
--def __str__(self):
--return "Command '%s' returned non-zero exit status %d" % 
(self.cmd, self.returncode)
-+if raw_input and input:
-+input = raw_input
-+except:
-+pass
- 
- verbose = False
- 
-@@ -105,7 +84,7 @@ def p4_build_cmd(cmd):
- # Provide a way to not pass this option by setting git-p4.retries to 0
- real_cmd += ["-r", str(retries)]
- 
--if isinstance(cmd,basestring):
-+if not isinstance(cmd, list):
- real_cmd = ' '.join(real_cmd) + ' ' + cmd
- else:
- real_cmd += cmd
-@@ -175,18 +154,48 @@ def prompt(prompt_text):
- """
- choices = set(m.group(1) for m in re.finditer(r"\[(.)\]", prompt_text))
- while True:
--response = raw_input(prompt_text).strip().lower()
-+response = input(prompt_text).strip().lower()
- if not response:
- continue
- response = response[0]
- if response in choices:
- return response
- 
-+# We need different encoding/decoding strategies for text data being passed
-+# around in pipes depending on python version
-+if bytes is not str:
-+# For python3, always encode and decode as appropriate
-+def decode_text_stream(s):
-+return s.decode() if isinstance(s, bytes) else s
-+def encode_text_stream(s):
-+return s.encode() if isinstance(s, str) else s
-+else:
-+# For python2.7, pass read strings as-is, but also allow writing unicode
-+def decode_text_stream(s):
-+return s
-+def encode_text_stream(s):
-+return s.encode('utf_8') if isinstance(s, unicode) else s
-+
-+def decode_path(path):
-+"""Decode a given string (bytes or otherwise) using configured path 
encoding options
-+"""
-+encoding = gitConfig('git-p4.pathEncoding') or 'utf_8'
-+if bytes is not str:
-+return path.decode(encoding, errors='replace') if isinstance(path, 
bytes) else path
-+else:
-+try:
-+path.decode('ascii')
-+except:
-+path = path.decode(encoding, errors='replace')
-+if verbose:
-+print('Path with non-ASCII characters detected. Used {} to 
decode: {}'.format(encoding, path))
-+return path
-+
- def write_pipe(c, stdin):
- if verbose:
- sys.stderr.write('Writing pipe: %s\n' % str(c))
- 
--expand = isinstance(c,basestring)
-+expand = not isinstance(c, list)
- p = subprocess.Popen(c, stdin=subprocess.PIPE, shell=expand)
- pipe = p.stdin
- val = pipe.write(stdin)
-@@ -198,6 +207,8 @@ def write_pipe(c, stdin):
- 
- def p4_write_pipe(c, stdin):
- real_cmd = p4_build_cmd(c)
-+ 

[arch-commits] Commit in git/trunk (0001-git-p4-python.patch PKGBUILD)

2020-01-13 Thread Christian Hesse via arch-commits
Date: Monday, January 13, 2020 @ 19:26:56
  Author: eworm
Revision: 373447

upgpkg: git 2.25.0-1

new upstream release

Modified:
  git/trunk/0001-git-p4-python.patch
  git/trunk/PKGBUILD

--+
 0001-git-p4-python.patch |  239 ++---
 PKGBUILD |8 -
 2 files changed, 58 insertions(+), 189 deletions(-)

Modified: 0001-git-p4-python.patch
===
--- 0001-git-p4-python.patch2020-01-13 19:13:09 UTC (rev 373446)
+++ 0001-git-p4-python.patch2020-01-13 19:26:56 UTC (rev 373447)
@@ -1,5 +1,5 @@
 diff --git a/git-p4.py b/git-p4.py
-index 60c73b6a37..d9df7747cb 100755
+index 40d9e7c594..ca0a874501 100755
 --- a/git-p4.py
 +++ b/git-p4.py
 @@ -8,12 +8,12 @@
@@ -71,25 +71,18 @@
  real_cmd = ' '.join(real_cmd) + ' ' + cmd
  else:
  real_cmd += cmd
-@@ -167,11 +146,56 @@ def die(msg):
- sys.stderr.write(msg + "\n")
- sys.exit(1)
+@@ -175,18 +154,48 @@ def prompt(prompt_text):
+ """
+ choices = set(m.group(1) for m in re.finditer(r"\[(.)\]", prompt_text))
+ while True:
+-response = raw_input(prompt_text).strip().lower()
++response = input(prompt_text).strip().lower()
+ if not response:
+ continue
+ response = response[0]
+ if response in choices:
+ return response
  
-+def prompt(prompt_text):
-+""" Prompt the user to choose one of the choices
-+
-+Choices are identified in the prompt_text by square brackets around
-+a single letter option.
-+"""
-+choices = set(m.group(1) for m in re.finditer(r"\[(.)\]", prompt_text))
-+while True:
-+response = input(prompt_text).strip().lower()
-+if not response:
-+continue
-+response = response[0]
-+if response in choices:
-+return response
-+
 +# We need different encoding/decoding strategies for text data being passed
 +# around in pipes depending on python version
 +if bytes is not str:
@@ -129,7 +122,7 @@
  p = subprocess.Popen(c, stdin=subprocess.PIPE, shell=expand)
  pipe = p.stdin
  val = pipe.write(stdin)
-@@ -183,6 +207,8 @@ def write_pipe(c, stdin):
+@@ -198,6 +207,8 @@ def write_pipe(c, stdin):
  
  def p4_write_pipe(c, stdin):
  real_cmd = p4_build_cmd(c)
@@ -138,7 +131,7 @@
  return write_pipe(real_cmd, stdin)
  
  def read_pipe_full(c):
-@@ -193,15 +219,17 @@ def read_pipe_full(c):
+@@ -208,15 +219,17 @@ def read_pipe_full(c):
  if verbose:
  sys.stderr.write('Reading pipe: %s\n' % str(c))
  
@@ -159,7 +152,7 @@
  """
  (retcode, out, err) = read_pipe_full(c)
  if retcode != 0:
-@@ -209,6 +237,8 @@ def read_pipe(c, ignore_error=False):
+@@ -224,6 +237,8 @@ def read_pipe(c, ignore_error=False):
  out = ""
  else:
  die('Command failed: %s\nError: %s' % (str(c), err))
@@ -168,7 +161,7 @@
  return out
  
  def read_pipe_text(c):
-@@ -219,23 +249,22 @@ def read_pipe_text(c):
+@@ -234,23 +249,22 @@ def read_pipe_text(c):
  if retcode != 0:
  return None
  else:
@@ -197,7 +190,7 @@
  return val
  
  def p4_read_pipe_lines(c):
-@@ -263,6 +292,7 @@ def p4_has_move_command():
+@@ -278,6 +292,7 @@ def p4_has_move_command():
  cmd = p4_build_cmd(["move", "-k", "@from", "@to"])
  p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
  (out, err) = p.communicate()
@@ -205,7 +198,7 @@
  # return code will be 1 in either case
  if err.find("Invalid option") >= 0:
  return False
-@@ -272,7 +302,7 @@ def p4_has_move_command():
+@@ -287,7 +302,7 @@ def p4_has_move_command():
  return True
  
  def system(cmd, ignore_error=False):
@@ -214,7 +207,7 @@
  if verbose:
  sys.stderr.write("executing %s\n" % str(cmd))
  retcode = subprocess.call(cmd, shell=expand)
-@@ -284,7 +314,7 @@ def system(cmd, ignore_error=False):
+@@ -299,7 +314,7 @@ def system(cmd, ignore_error=False):
  def p4_system(cmd):
  """Specifically invoke p4 as the system command. """
  real_cmd = p4_build_cmd(cmd)
@@ -223,7 +216,7 @@
  retcode = subprocess.call(real_cmd, shell=expand)
  if retcode:
  raise CalledProcessError(retcode, real_cmd)
-@@ -522,7 +552,7 @@ def getP4OpenedType(file):
+@@ -537,7 +552,7 @@ def getP4OpenedType(file):
  # Return the set of all p4 labels
  def getP4Labels(depotPaths):
  labels = set()
@@ -232,7 +225,7 @@
  depotPaths = [depotPaths]
  
  for l in p4CmdList(["labels"] + ["%s..." % p for p in depotPaths]):
-@@ -539,12 +569,7 @@ def getGitTags():
+@@ -554,12 +569,7 @@ def getGitTags():
  gitTags.add(tag)
  return gitTags
  
@@ -246,7 +239,7 @@
  
  def parseDiffTreeEntry(entry):
  """Parses a single diff tree entry into its component elements.
-@@ -565,7 +590,11 @@ def parseDiffTreeEntry(entry):
+@@ -580,7 +590,11 @@ def 

[arch-commits] Commit in git/trunk (0001-git-p4-python.patch PKGBUILD)

2019-12-29 Thread Christian Hesse via arch-commits
Date: Sunday, December 29, 2019 @ 19:43:24
  Author: eworm
Revision: 372336

upgpkg: git 2.24.1-4

fix 'git p4' with python 3.x (FS#64977)

Added:
  git/trunk/0001-git-p4-python.patch
Modified:
  git/trunk/PKGBUILD

--+
 0001-git-p4-python.patch |  762 +
 PKGBUILD |   10 
 2 files changed, 771 insertions(+), 1 deletion(-)

Added: 0001-git-p4-python.patch
===
--- 0001-git-p4-python.patch(rev 0)
+++ 0001-git-p4-python.patch2019-12-29 19:43:24 UTC (rev 372336)
@@ -0,0 +1,762 @@
+diff --git a/git-p4.py b/git-p4.py
+index 60c73b6a37..d9df7747cb 100755
+--- a/git-p4.py
 b/git-p4.py
+@@ -8,12 +8,12 @@
+ # License: MIT 
+ #
+ import sys
+-if sys.hexversion < 0x0204:
+-# The limiter is the subprocess module
+-sys.stderr.write("git-p4: requires Python 2.4 or later.\n")
++if sys.version_info.major < 3 and sys.version_info.minor < 7:
++sys.stderr.write("git-p4: requires Python 2.7 or later.\n")
+ sys.exit(1)
+ import os
+ import optparse
++import functools
+ import marshal
+ import subprocess
+ import tempfile
+@@ -27,36 +27,15 @@
+ import ctypes
+ import errno
+ 
++# On python2.7 where raw_input() and input() are both availble,
++# we want raw_input's semantics, but aliased to input for python3
++# compatibility
+ # support basestring in python3
+ try:
+-unicode = unicode
+-except NameError:
+-# 'unicode' is undefined, must be Python 3
+-str = str
+-unicode = str
+-bytes = bytes
+-basestring = (str,bytes)
+-else:
+-# 'unicode' exists, must be Python 2
+-str = str
+-unicode = unicode
+-bytes = str
+-basestring = basestring
+-
+-try:
+-from subprocess import CalledProcessError
+-except ImportError:
+-# from python2.7:subprocess.py
+-# Exception classes used by this module.
+-class CalledProcessError(Exception):
+-"""This exception is raised when a process run by check_call() returns
+-a non-zero exit status.  The exit status will be stored in the
+-returncode attribute."""
+-def __init__(self, returncode, cmd):
+-self.returncode = returncode
+-self.cmd = cmd
+-def __str__(self):
+-return "Command '%s' returned non-zero exit status %d" % 
(self.cmd, self.returncode)
++if raw_input and input:
++input = raw_input
++except:
++pass
+ 
+ verbose = False
+ 
+@@ -105,7 +84,7 @@ def p4_build_cmd(cmd):
+ # Provide a way to not pass this option by setting git-p4.retries to 0
+ real_cmd += ["-r", str(retries)]
+ 
+-if isinstance(cmd,basestring):
++if not isinstance(cmd, list):
+ real_cmd = ' '.join(real_cmd) + ' ' + cmd
+ else:
+ real_cmd += cmd
+@@ -167,11 +146,56 @@ def die(msg):
+ sys.stderr.write(msg + "\n")
+ sys.exit(1)
+ 
++def prompt(prompt_text):
++""" Prompt the user to choose one of the choices
++
++Choices are identified in the prompt_text by square brackets around
++a single letter option.
++"""
++choices = set(m.group(1) for m in re.finditer(r"\[(.)\]", prompt_text))
++while True:
++response = input(prompt_text).strip().lower()
++if not response:
++continue
++response = response[0]
++if response in choices:
++return response
++
++# We need different encoding/decoding strategies for text data being passed
++# around in pipes depending on python version
++if bytes is not str:
++# For python3, always encode and decode as appropriate
++def decode_text_stream(s):
++return s.decode() if isinstance(s, bytes) else s
++def encode_text_stream(s):
++return s.encode() if isinstance(s, str) else s
++else:
++# For python2.7, pass read strings as-is, but also allow writing unicode
++def decode_text_stream(s):
++return s
++def encode_text_stream(s):
++return s.encode('utf_8') if isinstance(s, unicode) else s
++
++def decode_path(path):
++"""Decode a given string (bytes or otherwise) using configured path 
encoding options
++"""
++encoding = gitConfig('git-p4.pathEncoding') or 'utf_8'
++if bytes is not str:
++return path.decode(encoding, errors='replace') if isinstance(path, 
bytes) else path
++else:
++try:
++path.decode('ascii')
++except:
++path = path.decode(encoding, errors='replace')
++if verbose:
++print('Path with non-ASCII characters detected. Used {} to 
decode: {}'.format(encoding, path))
++return path
++
+ def write_pipe(c, stdin):
+ if verbose:
+ sys.stderr.write('Writing pipe: %s\n' % str(c))
+ 
+-expand = isinstance(c,basestring)
++expand = not isinstance(c, list)
+ p = subprocess.Popen(c,