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> | 2014-11-14 14:46:24 +0200 |
commit | 30f9ff431b51549900951a6d9c0cc92a389ae0fc (patch) | |
tree | 3cb9dabe1b58f005f06f566c5992df00fb76bd42 /gbp | |
parent | dbb1ef413b9f305111b5e3bd67475c6d667ca432 (diff) | |
download | git-buildpackage-30f9ff431b51549900951a6d9c0cc92a389ae0fc.tar.gz git-buildpackage-30f9ff431b51549900951a6d9c0cc92a389ae0fc.tar.bz2 git-buildpackage-30f9ff431b51549900951a6d9c0cc92a389ae0fc.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>
Diffstat (limited to 'gbp')
-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 b6a05e2b..16e13750 100644 --- a/gbp/git/repository.py +++ b/gbp/git/repository.py @@ -321,6 +321,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(' -'): @@ -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 |