diff options
author | Markus Lehtonen <markus.lehtonen@linux.intel.com> | 2013-03-04 13:17:24 +0200 |
---|---|---|
committer | Markus Lehtonen <markus.lehtonen@linux.intel.com> | 2013-04-03 10:11:41 +0300 |
commit | 0252d0d0ec72be1008e0bbfbdd734bec33018e58 (patch) | |
tree | 75eb45bd71608d5ca8c890f968b2d764a0ee6cf2 | |
parent | f4b662204cf84ce0d3fd2165aa96ed4385e46a71 (diff) | |
download | git-buildpackage-0252d0d0ec72be1008e0bbfbdd734bec33018e58.tar.gz git-buildpackage-0252d0d0ec72be1008e0bbfbdd734bec33018e58.tar.bz2 git-buildpackage-0252d0d0ec72be1008e0bbfbdd734bec33018e58.zip |
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 <markus.lehtonen@linux.intel.com>
-rw-r--r-- | gbp/git/repository.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/gbp/git/repository.py b/gbp/git/repository.py index cc2c3860..098ac9aa 100644 --- a/gbp/git/repository.py +++ b/gbp/git/repository.py @@ -221,6 +221,7 @@ class GitRepository(object): section_re = re.compile(r'^(?P<section>[A-Z].*)') option_re = re.compile(r'--?(?P<name>[a-zA-Z\-]+).*') optopt_re = re.compile(r'--\[(?P<prefix>[a-zA-Z\-]+)\]-?') + backspace_re = re.compile(".\b") man_section = None for line in help.splitlines(): if man_section == "OPTIONS" and line.startswith(' -'): @@ -238,7 +239,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 |