annotate bitten/recipe/ctools.py @ 4:196009657e5e

Simplify the recipe commands interface: * The implementation of a command is now located using a pseudo-protocol for namespace URIs. * Commands are simply module-level functions instead of components. * Remove dependency of the recipe/slave code on the Trac component architecture.
author cmlenz
date Mon, 06 Jun 2005 15:54:29 +0000
parents
children 738a0ae251f6
rev   line source
4
196009657e5e Simplify the recipe commands interface:
cmlenz
parents:
diff changeset
1 from popen2 import Popen3
196009657e5e Simplify the recipe commands interface:
cmlenz
parents:
diff changeset
2
196009657e5e Simplify the recipe commands interface:
cmlenz
parents:
diff changeset
3 def make(basedir, target='all'):
196009657e5e Simplify the recipe commands interface:
cmlenz
parents:
diff changeset
4 """Execute a Makefile target."""
196009657e5e Simplify the recipe commands interface:
cmlenz
parents:
diff changeset
5 cmdline = 'make %s' % target
196009657e5e Simplify the recipe commands interface:
cmlenz
parents:
diff changeset
6 pipe = Popen3(cmdline, capturestderr=True) # FIXME: Windows compatibility
196009657e5e Simplify the recipe commands interface:
cmlenz
parents:
diff changeset
7 while True:
196009657e5e Simplify the recipe commands interface:
cmlenz
parents:
diff changeset
8 retval = pipe.poll()
196009657e5e Simplify the recipe commands interface:
cmlenz
parents:
diff changeset
9 if retval != -1:
196009657e5e Simplify the recipe commands interface:
cmlenz
parents:
diff changeset
10 break
196009657e5e Simplify the recipe commands interface:
cmlenz
parents:
diff changeset
11 line = pipe.fromchild.readline()
196009657e5e Simplify the recipe commands interface:
cmlenz
parents:
diff changeset
12 if line:
196009657e5e Simplify the recipe commands interface:
cmlenz
parents:
diff changeset
13 print '[make] %s' % line.rstrip()
196009657e5e Simplify the recipe commands interface:
cmlenz
parents:
diff changeset
14 line = pipe.childerr.readline()
196009657e5e Simplify the recipe commands interface:
cmlenz
parents:
diff changeset
15 if line:
196009657e5e Simplify the recipe commands interface:
cmlenz
parents:
diff changeset
16 print '[make] %s' % line.rstrip()
196009657e5e Simplify the recipe commands interface:
cmlenz
parents:
diff changeset
17 if retval != 0:
196009657e5e Simplify the recipe commands interface:
cmlenz
parents:
diff changeset
18 raise BuildError, "Executing distutils failed (%s)" % retval
Copyright (C) 2012-2017 Edgewall Software