forked from pool/rpmlint
Dirk Mueller
ab43937adf
OBS-URL: https://build.opensuse.org/package/show/devel:openSUSE:Factory:rpmlint/rpmlint?expand=0&rev=270
40 lines
1.5 KiB
Diff
40 lines
1.5 KiB
Diff
From 092a54ca23367c845f796f753fa8ff43746b844a Mon Sep 17 00:00:00 2001
|
|
From: Alberto Planas <aplanas@suse.com>
|
|
Date: Thu, 27 Feb 2014 16:35:13 +0100
|
|
Subject: [PATCH] Fix _unexpanded_macros for array values
|
|
|
|
---
|
|
TagsCheck.py | 17 ++++++++++++-----
|
|
1 file changed, 12 insertions(+), 5 deletions(-)
|
|
|
|
Index: rpmlint-1.5/TagsCheck.py
|
|
===================================================================
|
|
--- rpmlint-1.5.orig/TagsCheck.py
|
|
+++ rpmlint-1.5/TagsCheck.py
|
|
@@ -524,13 +524,20 @@ class TagsCheck(AbstractCheck.AbstractCh
|
|
AbstractCheck.AbstractCheck.__init__(self, 'TagsCheck')
|
|
|
|
def _unexpanded_macros(self, pkg, tagname, value, is_url=False):
|
|
+ def _check_value(value):
|
|
+ for match in AbstractCheck.macro_regex.findall(value):
|
|
+ # Do not warn about %XX URL escapes
|
|
+ if is_url and re.match('^%[0-9A-F][0-9A-F]$', match, re.I):
|
|
+ continue
|
|
+ printWarning(pkg, 'unexpanded-macro', tagname, match)
|
|
+
|
|
if not value:
|
|
return
|
|
- for match in AbstractCheck.macro_regex.findall(value):
|
|
- # Do not warn about %XX URL escapes
|
|
- if is_url and re.match('^%[0-9A-F][0-9A-F]$', match, re.I):
|
|
- continue
|
|
- printWarning(pkg, 'unexpanded-macro', tagname, match)
|
|
+ if isinstance(value, list):
|
|
+ for single_value in value:
|
|
+ _check_value(single_value)
|
|
+ else:
|
|
+ _check_value(value)
|
|
|
|
def check(self, pkg):
|
|
|