gnu: pybugz: Add fixlet patches.

* gnu/packages/python.scm (python2-pybugz)[source]: Add 'patches'
  field.
* gnu/packages/patches/pybugz-encode-error.patch,
  gnu/packages/patches/pybugz-stty.patch: New files.
* gnu-system.am (dist_patch_DATA): Add them.
This commit is contained in:
Ludovic Courtès 2014-05-05 17:12:55 +02:00
parent 515eba4543
commit 6f194a1e77
4 changed files with 42 additions and 1 deletions

View file

@ -326,6 +326,8 @@ dist_patch_DATA = \
gnu/packages/patches/petsc-fix-threadcomm.patch \ gnu/packages/patches/petsc-fix-threadcomm.patch \
gnu/packages/patches/plotutils-libpng-jmpbuf.patch \ gnu/packages/patches/plotutils-libpng-jmpbuf.patch \
gnu/packages/patches/procps-make-3.82.patch \ gnu/packages/patches/procps-make-3.82.patch \
gnu/packages/patches/pybugz-encode-error.patch \
gnu/packages/patches/pybugz-stty.patch \
gnu/packages/patches/python-fix-tests.patch \ gnu/packages/patches/python-fix-tests.patch \
gnu/packages/patches/python-libffi-mips-n32-fix.patch \ gnu/packages/patches/python-libffi-mips-n32-fix.patch \
gnu/packages/patches/qt4-tests.patch \ gnu/packages/patches/qt4-tests.patch \

View file

@ -0,0 +1,17 @@
In case of 'AttributeError', 'value' is None, so do not try to
access it.
Submitted upstream.
--- pybugz-0.6.11/bugz.py 2006-09-02 14:35:37.000000000 +0200
+++ pybugz-0.6.11/bugz.py 2014-05-05 16:02:20.000000000 +0200
@@ -1249,9 +1254,9 @@ class PrettyBugz(Bugz):
for field, name in FIELDS + MORE_FIELDS:
try:
value = result.find('//%s' % field).text
+ print '%-12s: %s' % (name, value.encode(self.enc))
except AttributeError:
continue
- print '%-12s: %s' % (name, value.encode(self.enc))
# Print out the cc'ed people
cced = result.findall('.//cc')

View file

@ -0,0 +1,19 @@
Gracefully deal with 'stty size' failures.
Submitted upstream.
--- pybugz-0.6.11/bugz.py 2006-09-02 14:35:37.000000000 +0200
+++ pybugz-0.6.11/bugz.py 2014-05-05 15:17:03.000000000 +0200
@@ -288,7 +288,12 @@ def get_cols():
stty = which('stty')
if stty:
row_cols = commands.getoutput("%s size" % stty)
- rows, cols = map(int, row_cols.split())
+ try:
+ rows, cols = map(int, row_cols.split())
+ except:
+ # In some cases 'stty size' will just fail with
+ # "Inappropriate ioctl for device".
+ cols = DEFAULT_NUM_COLS
return cols
else:
return DEFAULT_NUM_COLS

View file

@ -578,7 +578,10 @@ (define-public python2-pybugz
version ".tar.gz")) version ".tar.gz"))
(sha256 (sha256
(base32 (base32
"17ni00p08gp5lkxlrrcnvi3x09fmajnlbz4da03qcgl9q21ym4jd")))) "17ni00p08gp5lkxlrrcnvi3x09fmajnlbz4da03qcgl9q21ym4jd"))
(patches (map search-patch
(list "pybugz-stty.patch"
"pybugz-encode-error.patch")))))
(build-system python-build-system) (build-system python-build-system)
(arguments (arguments
`(#:python ,python-2 ; SyntaxError with Python 3 `(#:python ,python-2 ; SyntaxError with Python 3