Gentoo Logo
Gentoo Spaceship




Note: Due to technical difficulties, the Archives are currently not up to date. GMANE provides an alternative service for most mailing lists.
c.f. bug 424647
List Archive: gentoo-portage-dev
Navigation:
Lists: gentoo-portage-dev: < Prev By Thread Next > < Prev By Date Next >
Headers:
To: gentoo-portage-dev@g.o
From: Sebastian Pipping <sping@g.o>
Subject: [PATCH] Move regex creation out of PhaseCheck constructor (Revision: 15458)
Date: Fri, 26 Feb 2010 21:28:54 +0100
From a07a07166354e328711d1574eb06f7d357f21907 Mon Sep 17 00:00:00 2001
From: Sebastian Pipping <sebastian@...>
Date: Fri, 26 Feb 2010 21:19:06 +0100
Subject: [PATCH] Move regex creation out of PhaseCheck constructor

---
 pym/repoman/checks.py |   16 +++++++++-------
 1 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/pym/repoman/checks.py b/pym/repoman/checks.py
index 27e02d2..02b8d03 100644
--- a/pym/repoman/checks.py
+++ b/pym/repoman/checks.py
@@ -30,21 +30,23 @@ class LineCheck(object):
 	def end(self):
 		pass
 
+
+_ebuild_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 = '(%s)' % '|'.join(_ebuild_phases)
+del _ebuild_phases
+
+
 class PhaseCheck(LineCheck):
 	""" basic class for function detection """
 
 	ignore_line = re.compile(r'(^\s*#)')
 	func_end_re = re.compile(r'^\}$')
+	phases_re = re.compile(_phase_re)
 	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)
+		pass
 
 	def check(self, num, line):
 		m = self.phases_re.match(line)
-- 
1.6.6

Replies:
Re: [PATCH] Move regex creation out of PhaseCheck constructor (Revision: 15458)
-- Zac Medico
Navigation:
Lists: gentoo-portage-dev: < Prev By Thread Next > < Prev By Date Next >
Previous by thread:
Is there any way to stop compilation and resume it later (after a reboot)?
Next by thread:
Re: [PATCH] Move regex creation out of PhaseCheck constructor (Revision: 15458)
Previous by date:
Re: Is there any way to stop compilation and resume it later (after a reboot)?
Next by date:
Re: [PATCH] Move regex creation out of PhaseCheck constructor (Revision: 15458)


Updated Jun 13, 2012

Summary: Archive of the gentoo-portage-dev mailing list.

Donate to support our development efforts.

Copyright 2001-2013 Gentoo Foundation, Inc. Questions, Comments? Contact us.