summaryrefslogtreecommitdiffstats
path: root/SConstruct
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2009-01-09 16:43:32 (GMT)
committerSteven Knight <knight@baldmt.com>2009-01-09 16:43:32 (GMT)
commit7ab76c68556e5f6f142515872ea6334e959b8626 (patch)
treec4d23aed9df4381a24cac247b11dd1a4c245908a /SConstruct
parente04fb604484cf37da383a38ef9b2bd8c9ef6c175 (diff)
downloadSCons-7ab76c68556e5f6f142515872ea6334e959b8626.zip
SCons-7ab76c68556e5f6f142515872ea6334e959b8626.tar.gz
SCons-7ab76c68556e5f6f142515872ea6334e959b8626.tar.bz2
Issue 1086: add support for generic batch build actions, and
specific support for batched compilation for Microsoft Visual C/C++. Merged revisions 3819-3851,3854-3869,3871-3877,3880 via svnmerge from http://scons.tigris.org/svn/scons/branches/sgk_batch ........ r3820 | stevenknight | 2008-12-09 23:59:14 -0800 (Tue, 09 Dec 2008) | 6 lines Issue 1086: Batch compilation support: * $MSVC_BATCH to control Visual C/C++ batch compilation. * New $CHANGED_SOURCES, $CHANGED_TARGETS, $UNCHANGED_SOURCES and $UNCHANGED_TARGETS construction variables. * New Action(batch_key=, targets=) keyword arguments. ........ r3880 | stevenknight | 2009-01-07 20:50:41 -0800 (Wed, 07 Jan 2009) | 3 lines Use UniqueList objects to collect the all_children(), all_prerequisites() and all_sources() lists instead of calling uniquer_hashables() by hand. ........
Diffstat (limited to 'SConstruct')
-rw-r--r--SConstruct58
1 files changed, 45 insertions, 13 deletions
diff --git a/SConstruct b/SConstruct
index 0395720..4b38629 100644
--- a/SConstruct
+++ b/SConstruct
@@ -76,6 +76,7 @@ dh_builddeb = whereis('dh_builddeb')
fakeroot = whereis('fakeroot')
gzip = whereis('gzip')
rpmbuild = whereis('rpmbuild') or whereis('rpm')
+hg = whereis('hg')
svn = whereis('svn')
unzip = whereis('unzip')
zip = whereis('zip')
@@ -104,12 +105,45 @@ version = ARGUMENTS.get('VERSION', '')
if not version:
version = default_version
+hg_status_lines = []
+svn_status_lines = []
+
+if hg:
+ cmd = "%s status --all 2> /dev/null" % hg
+ hg_status_lines = os.popen(cmd, "r").readlines()
+
+if svn:
+ cmd = "%s status --verbose 2> /dev/null" % svn
+ svn_status_lines = os.popen(cmd, "r").readlines()
+
revision = ARGUMENTS.get('REVISION', '')
+def generate_build_id(revision):
+ return revision
+
+if not revision and hg:
+ hg_heads = os.popen("%s heads 2> /dev/null" % hg, "r").read()
+ cs = re.search('changeset:\s+(\S+)', hg_heads)
+ if cs:
+ revision = cs.group(1)
+ b = re.search('branch:\s+(\S+)', hg_heads)
+ if b:
+ revision = b.group(1) + ':' + revision
+ def generate_build_id(revision):
+ result = revision
+ if filter(lambda l: l[0] in 'AMR!', hg_status_lines):
+ result = result + '[MODIFIED]'
+ return result
+
if not revision and svn:
svn_info = os.popen("%s info 2> /dev/null" % svn, "r").read()
m = re.search('Revision: (\d+)', svn_info)
if m:
revision = m.group(1)
+ def generate_build_id(revision):
+ result = 'r' + revision
+ if filter(lambda l: l[0] in 'ACDMR', svn_status_lines):
+ result = result + '[MODIFIED]'
+ return result
checkpoint = ARGUMENTS.get('CHECKPOINT', '')
if checkpoint:
@@ -120,19 +154,10 @@ if checkpoint:
checkpoint = 'r' + revision
version = version + '.' + checkpoint
-svn_status = None
-svn_status_lines = []
-
-if svn:
- svn_status = os.popen("%s status --verbose 2> /dev/null" % svn, "r").read()
- svn_status_lines = svn_status[:-1].split('\n')
-
build_id = ARGUMENTS.get('BUILD_ID')
if build_id is None:
if revision:
- build_id = 'r' + revision
- if filter(lambda l: l[0] in 'ACDMR', svn_status_lines):
- build_id = build_id + '[MODIFIED]'
+ build_id = generate_build_id(revision)
else:
build_id = ''
@@ -1173,17 +1198,24 @@ SConscript('doc/SConscript')
# source archive from the project files and files in the change.
#
-if not svn_status:
- "Not building in a Subversion tree; skipping building src package."
-else:
+sfiles = None
+if hg_status_lines:
+ slines = filter(lambda l: l[0] in 'ACM', hg_status_lines)
+ sfiles = map(lambda l: l.split()[-1], slines)
+elif svn_status_lines:
slines = filter(lambda l: l[0] in ' MA', svn_status_lines)
sentries = map(lambda l: l.split()[-1], slines)
sfiles = filter(os.path.isfile, sentries)
+else:
+ "Not building in a Mercurial or Subversion tree; skipping building src package."
+if sfiles:
remove_patterns = [
+ '.hgt/*',
'.svnt/*',
'*.aeignore',
'*.cvsignore',
+ '*.hgignore',
'www/*',
]