From: Markus Lehtonen Date: Mon, 4 Mar 2013 11:17:24 +0000 (+0200) Subject: CentOS compatibility: fix GitRepository._cmd_has_feature() X-Git-Tag: debian/0.6.25~91 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c7d83ad6f25e76341d4b579370def6e13281630c;p=tools%2Fgit-buildpackage.git CentOS compatibility: fix GitRepository._cmd_has_feature() Make it work in CentOS 6.3 with older git by removing backspace characters when examining man page section names. Signed-off-by: Markus Lehtonen --- diff --git a/gbp/git/repository.py b/gbp/git/repository.py index 6f10081..b4588e3 100644 --- a/gbp/git/repository.py +++ b/gbp/git/repository.py @@ -321,6 +321,7 @@ class GitRepository(object): section_re = re.compile(r'^(?P
[A-Z].*)') option_re = re.compile(r'--?(?P[a-zA-Z\-]+).*') optopt_re = re.compile(r'--\[(?P[a-zA-Z\-]+)\]-?') + backspace_re = re.compile(".\b") man_section = None for line in help.splitlines(): if man_section == "OPTIONS" and line.startswith(' -'): @@ -338,7 +339,7 @@ class GitRepository(object): # Check man section match = section_re.match(line) if match: - man_section = match.group('section') + man_section = backspace_re.sub('', match.group('section')) return False @property