[Reportbug-commits] [reportbug] 03/27: utils.py: Do not use localized package description

Sandro Tosi morph at moszumanska.debian.org
Mon May 29 20:14:05 UTC 2017


This is an automated email from the git hooks/post-receive script.

morph pushed a commit to branch master
in repository reportbug.

commit 7ebb30d888effd3708a7892765d75e218957f934
Author: Nis Martensen <nis.martensen at web.de>
Date:   Sun May 28 13:07:25 2017 +0200

    utils.py: Do not use localized package description
    
    .. and unify the regexps used for getting the description, so that we
    never accidentally use the Description-md5 field.
---
 reportbug/utils.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/reportbug/utils.py b/reportbug/utils.py
index 51c9d23..e238a8d 100644
--- a/reportbug/utils.py
+++ b/reportbug/utils.py
@@ -362,7 +362,7 @@ def get_package_status(package, avail=False):
     packarg = pipes.quote(package)
     if avail:
         output = get_command_output(
-            "apt-cache show %s 2>/dev/null" % packarg)
+            "LC_ALL=C.UTF-8 apt-cache show %s 2>/dev/null" % packarg)
     else:
         output = get_command_output(
             "COLUMNS=79 dpkg --status %s 2>/dev/null" % packarg)
@@ -525,7 +525,7 @@ def get_avail_database():
 
 def available_package_description(package):
     data = get_command_output('apt-cache show ' + pipes.quote(package))
-    descre = re.compile('^Description(?:-.*)?: (.*)$')
+    descre = re.compile('^Description(?:-[a-zA-Z]+)?: (.*)$')
     for line in data.split('\n'):
         m = descre.match(line)
         if m:
@@ -599,7 +599,7 @@ def get_package_info(packages, skip_notfound=False):
     packob = re.compile('^Package: (?P<pkg>.*)$', re.MULTILINE)
     statob = re.compile('^Status: (?P<stat>.*)$', re.MULTILINE)
     versob = re.compile('^Version: (?P<vers>.*)$', re.MULTILINE)
-    descob = re.compile('^Description(?:-.*)?: (?P<desc>.*)$', re.MULTILINE)
+    descob = re.compile('^Description(?:-[a-zA-Z]+)?: (?P<desc>.*)$', re.MULTILINE)
 
     ret = []
     for p in packinfo:

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reportbug/reportbug.git



More information about the Reportbug-commits mailing list