diff options
-rw-r--r-- | pym/repoman/checks.py | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/pym/repoman/checks.py b/pym/repoman/checks.py index 941cb4188..79ba892e6 100644 --- a/pym/repoman/checks.py +++ b/pym/repoman/checks.py @@ -35,17 +35,13 @@ class PhaseCheck(LineCheck): ignore_line = re.compile(r'(^\s*#)') func_end_re = re.compile(r'^\}$') + phases_re = re.compile('(%s)' % '|'.join(( + 'pkg_pretend', 'pkg_setup', 'src_unpack', 'src_prepare', + 'src_configure', 'src_compile', 'src_test', 'src_install', + 'pkg_preinst', 'pkg_postinst', 'pkg_prerm', 'pkg_postrm', + 'pkg_config'))) in_phase = '' - def __init__(self): - self.phases = ('pkg_pretend', 'pkg_setup', 'src_unpack', 'src_prepare', 'src_configure', 'src_compile', - 'src_test', 'src_install', 'pkg_preinst', 'pkg_postinst', 'pkg_prerm', 'pkg_postrm', 'pkg_config') - phase_re = '(' - for phase in self.phases: - phase_re += phase + '|' - phase_re = phase_re[:-1] + ')' - self.phases_re = re.compile(phase_re) - def check(self, num, line): m = self.phases_re.match(line) if m is not None: |