SHA256
1
0
forked from pool/rpmlint

- add 0001-Always-import-XDG-desktop-files-as-utf8.patch

OBS-URL: https://build.opensuse.org/package/show/devel:openSUSE:Factory:rpmlint/rpmlint?expand=0&rev=567
This commit is contained in:
Dirk Mueller 2018-02-18 14:28:33 +00:00 committed by Git OBS Bridge
parent 27e0f946b3
commit fc588f707f
4 changed files with 42 additions and 1 deletions

View File

@ -0,0 +1,35 @@
From e090267a175d2f2d52128c780108835f36d1ef1e Mon Sep 17 00:00:00 2001
From: Dirk Mueller <dirk@dmllr.de>
Date: Sun, 18 Feb 2018 15:23:39 +0100
Subject: [PATCH] Always import XDG desktop files as utf8
Don't rely on them being entirely ASCII or the system
locale.
---
MenuXDGCheck.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/MenuXDGCheck.py b/MenuXDGCheck.py
index 66912ea..d4418a9 100644
--- a/MenuXDGCheck.py
+++ b/MenuXDGCheck.py
@@ -6,6 +6,7 @@
# http://standards.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html
#
+import codecs
import os
try:
import ConfigParser as cfgparser
@@ -30,7 +31,7 @@ class MenuXDGCheck(AbstractCheck.AbstractFilesCheck):
def parse_desktop_file(self, pkg, root, f, filename):
cfp = cfgparser.RawConfigParser()
try:
- with open(f, 'rb') as inputf:
+ with codecs.open(f, encoding='utf-8') as inputf:
cfp.readfp(inputf, filename)
except cfgparser.DuplicateSectionError as e:
printError(
--
2.16.1

View File

@ -41,7 +41,7 @@ Index: rpmlint-rpmlint-1.10/MenuXDGCheck.py
+ def parse_desktop_file(self, pkg, root, f, filename):
+ cfp = cfgparser.RawConfigParser()
+ try:
+ with open(f, 'r') as inputf:
+ with open(f, 'rb') as inputf:
+ cfp.readfp(inputf, filename)
+ except cfgparser.DuplicateSectionError as e:
+ printError(

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Sun Feb 18 14:26:09 UTC 2018 - dmueller@suse.com
- add 0001-Always-import-XDG-desktop-files-as-utf8.patch
-------------------------------------------------------------------
Thu Feb 15 09:35:51 UTC 2018 - coolo@suse.com

View File

@ -89,6 +89,7 @@ Patch70: rpmlint-all-pie.patch
Patch71: 0001-Avoid-calling-close-on-undefined-fd-variable.patch
Patch72: rpmlint-slpp-NUM-NUM.patch
Patch73: 0001-Binariescheck-Check-for-chroot-chdir-on-ARM-PPC.patch
Patch74: 0001-Always-import-XDG-desktop-files-as-utf8.patch
BuildRequires: obs-service-format_spec_file
BuildRequires: python3-flake8
BuildRequires: python3-pytest