From 7a7cb5dedfcc197618128eeb17367fca24bdab157b61338237dc93e92f80f0a9 Mon Sep 17 00:00:00 2001 From: OBS User autobuild Date: Tue, 6 Apr 2010 20:38:58 +0000 Subject: [PATCH] Accepting request 37121 from Base:System Copy from Base:System/rpmlint based on submit request 37121 from user dirkmueller OBS-URL: https://build.opensuse.org/request/show/37121 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/rpmlint?expand=0&rev=57 --- filename-non-utf8-exception.diff | 18 ++++++++++++++++++ rpmlint.changes | 5 +++++ rpmlint.spec | 4 +++- suse-url-check.diff | 10 +++++++++- 4 files changed, 35 insertions(+), 2 deletions(-) create mode 100644 filename-non-utf8-exception.diff diff --git a/filename-non-utf8-exception.diff b/filename-non-utf8-exception.diff new file mode 100644 index 0000000..0300b3b --- /dev/null +++ b/filename-non-utf8-exception.diff @@ -0,0 +1,18 @@ +--- Filter.py ++++ Filter.py +@@ -22,13 +22,8 @@ + _badness_score = 0 + printed_messages = { "I": 0, "W": 0, "E": 0 } + +-if sys.stdout.isatty(): +- def __print(s): +- print(s) +-else: +- import locale +- def __print(s): +- print(s.encode(locale.getpreferredencoding(), "replace")) ++def __print(s): ++ print(s) + + def printInfo(pkg, reason, *details): + _print("I", pkg, reason, details) diff --git a/rpmlint.changes b/rpmlint.changes index c28107d..42cd2a7 100644 --- a/rpmlint.changes +++ b/rpmlint.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Tue Apr 6 18:31:35 CEST 2010 - dmueller@suse.de + +- workaround unicode error exceptions on non-utf8 filenames + ------------------------------------------------------------------- Fri Apr 2 13:53:56 CEST 2010 - dmueller@suse.de diff --git a/rpmlint.spec b/rpmlint.spec index fb9c047..815078c 100644 --- a/rpmlint.spec +++ b/rpmlint.spec @@ -23,7 +23,7 @@ Name: rpmlint BuildRequires: rpm-python Summary: Rpm correctness checker Version: 0.95 -Release: 2 +Release: 3 Source0: %{name}-%{version}.tar.bz2 Source1: config Source1001: config.in @@ -110,6 +110,7 @@ Patch69: useless-requires-doc.diff Patch71: suse-binary-info-compile-opts.diff Patch72: version-control-internal-file.diff Patch73: avoid-mismatched-libregex.diff +Patch74: filename-non-utf8-exception.diff %py_requires %description @@ -179,6 +180,7 @@ Authors: #%patch71 %patch72 %patch73 +%patch74 cp -p %{SOURCE1} . cp -p %{SOURCE2} . cp -p %{SOURCE3} . diff --git a/suse-url-check.diff b/suse-url-check.diff index 5e38da0..bd30b03 100644 --- a/suse-url-check.diff +++ b/suse-url-check.diff @@ -1,6 +1,14 @@ --- TagsCheck.py +++ TagsCheck.py -@@ -748,7 +748,7 @@ +@@ -741,14 +741,14 @@ + if not valid_license: + self._unexpanded_macros(pkg, 'License', rpm_license) + +- for tag in ('URL', 'DistURL', 'BugURL'): ++ for tag in ('URL', 'BugURL'): + if hasattr(rpm, 'RPMTAG_%s' % tag.upper()): + url = pkg[getattr(rpm, 'RPMTAG_%s' % tag.upper())] + self._unexpanded_macros(pkg, tag, url, is_url = True) if url: (scheme, netloc) = urlparse(url)[0:2] if not scheme or not netloc or "." not in netloc or \