class SpecFile(object):
"""Class for parsing/modifying spec files"""
tag_re = re.compile(r'^(?P<name>[a-z]+)(?P<num>[0-9]+)?\s*:\s*'
- '(?P<value>\S(.*\S)?)\s*$', flags=re.I)
+ r'(?P<value>\S(.*\S)?)\s*$', flags=re.I)
directive_re = re.compile(r'^%(?P<name>[a-z]+)(?P<num>[0-9]+)?'
- '(\s+(?P<args>.*))?$', flags=re.I)
+ r'(\s+(?P<args>.*))?$', flags=re.I)
gbptag_re = re.compile(r'^\s*#\s*gbp-(?P<name>[a-z-]+)'
- '(\s*:\s*(?P<args>\S.*))?$', flags=re.I)
+ r'(\s*:\s*(?P<args>\S.*))?$', flags=re.I)
# Here "sections" stand for all scripts, scriptlets and other directives,
# but not macros
section_identifiers = ('package', 'description', 'prep', 'build', 'install',
name = commit_info['author']['name']
email = commit_info['author']['email']
# Git compat: put name in quotes if special characters found
- if re.search("[,.@()\[\]\\\:;]", name):
+ if re.search(r"[,.@()\[\]\\\:;]", name):
name = '"%s"' % name
from_header = Header(header_name='from')
try:
if renumber:
# Remove any existing numeric prefix if the patch
# should be renumbered
- name = re.sub('^\d+[-_]*', '', name)
+ name = re.sub(r'^\d+[-_]*', '', name)
else:
# Otherwise, clear proposed prefix
num_prefix = ''