SHA256
1
0
forked from pool/rpmlint

- add 0001-Avoid-messing-with-the-error-encoding-Fixes-61.patch (bsc#967556)

- fix requires

OBS-URL: https://build.opensuse.org/package/show/devel:openSUSE:Factory:rpmlint/rpmlint?expand=0&rev=372
This commit is contained in:
Dirk Mueller 2016-02-22 08:21:14 +00:00 committed by Git OBS Bridge
parent 81ff1e38fb
commit 6b2de62510
3 changed files with 83 additions and 0 deletions

View File

@ -0,0 +1,75 @@
From 6d0278d1fb39426467f79ec5bd1637b2d95cca3b Mon Sep 17 00:00:00 2001
From: Dirk Mueller <dirk@dmllr.de>
Date: Mon, 22 Feb 2016 09:12:39 +0100
Subject: [PATCH] Avoid messing with the error encoding (Fixes #61)
Rather than doing something different in the tty/non-tty case,
just call print() directly, which does the right thing without
throwing exceptions.
---
Filter.py | 24 ++++--------------------
1 file changed, 4 insertions(+), 20 deletions(-)
Index: rpmlint-rpmlint-1.8/Filter.py
===================================================================
--- rpmlint-rpmlint-1.8.orig/Filter.py
+++ rpmlint-rpmlint-1.8/Filter.py
@@ -9,7 +9,6 @@
from __future__ import print_function
import locale
-import sys
import textwrap
import Config
@@ -24,21 +23,6 @@ _diagnostic = list()
_badness_score = 0
printed_messages = {"I": 0, "W": 0, "E": 0}
-if sys.stdout.isatty():
- def __print(s):
- print(s)
-else:
- __stdout = sys.stdout
- if not __stdout.encoding: # Python < 3 only?
- import codecs
- if hasattr(__stdout, "buffer"):
- __stdout = __stdout.buffer
- __stdout = codecs.getwriter(
- locale.getpreferredencoding())(__stdout, "replace")
-
- def __print(s):
- print(s, file=__stdout)
-
def printInfo(pkg, reason, *details):
_print("I", pkg, reason, details)
@@ -90,7 +74,7 @@ def _print(msgtype, pkg, reason, details
if threshold >= 0:
_diagnostic.append(s + "\n")
else:
- __print(s)
+ print(s)
if Config.info:
printDescriptions(reason)
return True
@@ -102,8 +86,8 @@ def printDescriptions(reason):
try:
d = _details[reason]
if d and d != '' and d != "\n":
- __print(textwrap.fill(d, 78))
- __print("")
+ print(textwrap.fill(d, 78))
+ print("")
except KeyError:
pass
@@ -128,7 +112,7 @@ def printAllReasons():
if len(last_reason):
printDescriptions(last_reason)
last_reason = reason
- __print(diag[:-1])
+ print(diag[:-1])
if Config.info and len(last_reason):
printDescriptions(last_reason)
_diagnostic = list()

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Mon Feb 22 08:16:34 UTC 2016 - dmueller@suse.com
- add 0001-Avoid-messing-with-the-error-encoding-Fixes-61.patch (bsc#967556)
- fix requires
-------------------------------------------------------------------
Fri Feb 12 14:43:00 UTC 2016 - sleep_walker@opensuse.org

View File

@ -47,6 +47,7 @@ Requires: desktop-file-utils
Requires: file
Requires: findutils
Requires: python-magic
Requires: python-xml
Requires: rpm-python
# Requirement for ErlangCheck.py (pull-request #2).
Requires: python-pybeam
@ -110,6 +111,7 @@ Patch50: fix-shared-library-matching.diff
Patch51: postin-speedup.diff
# https://github.com/rpm-software-management/rpmlint/commit/37fe9d4f237c2cb29fcb3b60d1ece189e578eeaf.patch and followup regression fixes
Patch52: binaryinfo-speedup.diff
Patch53: 0001-Avoid-messing-with-the-error-encoding-Fixes-61.patch
# PATCHLIST END
# BuildArch must at the end. is a bug: https://bugzilla.suse.com/show_bug.cgi?id=926766
BuildArch: noarch