scons-doc-2.3.0/bin/ 0000755 0001750 0001750 00000000000 12114661557 014772 5 ustar dktrkranz dktrkranz scons-doc-2.3.0/bin/memoicmp.py 0000644 0001750 0001750 00000004631 12114661557 017156 0 ustar dktrkranz dktrkranz #!/usr/bin/env python
#
# A script to compare the --debug=memoizer output found in
# two different files.
import sys
def memoize_output(fname):
mout = {}
#lines=filter(lambda words:
# len(words) == 5 and
# words[1] == 'hits' and words[3] == 'misses',
# map(string.split, open(fname,'r').readlines()))
#for line in lines:
# mout[line[-1]] = ( int(line[0]), int(line[2]) )
for line in open(fname,'r').readlines():
words = line.split()
if len(words) == 5 and words[1] == 'hits' and words[3] == 'misses':
mout[words[-1]] = ( int(words[0]), int(words[2]) )
return mout
def memoize_cmp(filea, fileb):
ma = memoize_output(filea)
mb = memoize_output(fileb)
print 'All output: %s / %s [delta]'%(filea, fileb)
print '----------HITS---------- ---------MISSES---------'
cfmt='%7d/%-7d [%d]'
ma_o = []
mb_o = []
mab = []
for k in ma.keys():
if k in mb.keys():
if k not in mab:
mab.append(k)
else:
ma_o.append(k)
for k in mb.keys():
if k in ma.keys():
if k not in mab:
mab.append(k)
else:
mb_o.append(k)
mab.sort()
ma_o.sort()
mb_o.sort()
for k in mab:
hits = cfmt%(ma[k][0], mb[k][0], mb[k][0]-ma[k][0])
miss = cfmt%(ma[k][1], mb[k][1], mb[k][1]-ma[k][1])
print '%-24s %-24s %s'%(hits, miss, k)
for k in ma_o:
hits = '%7d/ --'%(ma[k][0])
miss = '%7d/ --'%(ma[k][1])
print '%-24s %-24s %s'%(hits, miss, k)
for k in mb_o:
hits = ' -- /%-7d'%(mb[k][0])
miss = ' -- /%-7d'%(mb[k][1])
print '%-24s %-24s %s'%(hits, miss, k)
print '-'*(24+24+1+20)
if __name__ == "__main__":
if len(sys.argv) != 3:
print """Usage: %s file1 file2
Compares --debug=memomize output from file1 against file2."""%sys.argv[0]
sys.exit(1)
memoize_cmp(sys.argv[1], sys.argv[2])
sys.exit(0)
# Local Variables:
# tab-width:4
# indent-tabs-mode:nil
# End:
# vim: set expandtab tabstop=4 shiftwidth=4:
scons-doc-2.3.0/bin/caller-tree.py 0000644 0001750 0001750 00000006150 12114661557 017545 0 ustar dktrkranz dktrkranz #!/usr/bin/env python
#
# Quick script to process the *summary* output from SCons.Debug.caller()
# and print indented calling trees with call counts.
#
# The way to use this is to add something like the following to a function
# for which you want information about who calls it and how many times:
#
# from SCons.Debug import caller
# caller(0, 1, 2, 3, 4, 5)
#
# Each integer represents how many stack frames back SCons will go
# and capture the calling information, so in the above example it will
# capture the calls six levels up the stack in a central dictionary.
#
# At the end of any run where SCons.Debug.caller() is used, SCons will
# print a summary of the calls and counts that looks like the following:
#
# Callers of Node/__init__.py:629(calc_signature):
# 1 Node/__init__.py:683(calc_signature)
# Callers of Node/__init__.py:676(gen_binfo):
# 6 Node/FS.py:2035(current)
# 1 Node/__init__.py:722(get_bsig)
#
# If you cut-and-paste that summary output and feed it to this script
# on standard input, it will figure out how these entries hook up and
# print a calling tree for each one looking something like:
#
# Node/__init__.py:676(gen_binfo)
# Node/FS.py:2035(current) 6
# Taskmaster.py:253(make_ready_current) 18
# Script/Main.py:201(make_ready) 18
#
# Note that you should *not* look at the call-count numbers in the right
# hand column as the actual number of times each line *was called by*
# the function on the next line. Rather, it's the *total* number
# of times each function was found in the call chain for any of the
# calls to SCons.Debug.caller(). If you're looking at more than one
# function at the same time, for example, their counts will intermix.
# So use this to get a *general* idea of who's calling what, not for
# fine-grained performance tuning.
import sys
class Entry(object):
def __init__(self, file_line_func):
self.file_line_func = file_line_func
self.called_by = []
self.calls = []
AllCalls = {}
def get_call(flf):
try:
e = AllCalls[flf]
except KeyError:
e = AllCalls[flf] = Entry(flf)
return e
prefix = 'Callers of '
c = None
for line in sys.stdin.readlines():
if line[0] == '#':
pass
elif line[:len(prefix)] == prefix:
c = get_call(line[len(prefix):-2])
else:
num_calls, flf = line.strip().split()
e = get_call(flf)
c.called_by.append((e, num_calls))
e.calls.append(c)
stack = []
def print_entry(e, level, calls):
print '%-72s%6s' % ((' '*2*level) + e.file_line_func, calls)
if e in stack:
print (' '*2*(level+1))+'RECURSION'
print
elif e.called_by:
stack.append(e)
for c in e.called_by:
print_entry(c[0], level+1, c[1])
stack.pop()
else:
print
for e in [ e for e in AllCalls.values() if not e.calls ]:
print_entry(e, 0, '')
# Local Variables:
# tab-width:4
# indent-tabs-mode:nil
# End:
# vim: set expandtab tabstop=4 shiftwidth=4:
scons-doc-2.3.0/bin/scp-sourceforge 0000755 0001750 0001750 00000001720 12114661557 020026 0 ustar dktrkranz dktrkranz #!/bin/bash
set -x
set -e
if [ -z "$1" ]; then
echo usage: $0 SourceForgeUserName
exit
fi
SF_USER=$1
rm -rf sf
for p in scons scons-src scons-local
do
mkdir -p sf/$p/$VERSION
cp -p src/Announce.txt \
build/scons/CHANGES.txt \
build/scons/RELEASE.txt \
sf/$p/$VERSION
done
cp -p build/dist/scons-$VERSION-1.noarch.rpm \
build/dist/scons-$VERSION-1.src.rpm \
build/dist/scons-$VERSION.tar.gz \
build/dist/scons-$VERSION.win32.exe \
build/dist/scons-$VERSION.zip \
sf/scons/$VERSION
cp -p build/dist/scons-local-$VERSION.tar.gz \
build/dist/scons-local-$VERSION.zip \
sf/scons-src/$VERSION
cp -p build/dist/scons-src-$VERSION.tar.gz \
build/dist/scons-src-$VERSION.zip \
sf/scons-local/$VERSION
# Transmit them in this order, since the most-recent is displayed at the top
scp -r sf/scons-local/ sf/scons-src/ sf/scons/ \
$SF_USER,scons@frs.sourceforge.net:/home/pfs/project/s/sc/scons
rm -rf sf
scons-doc-2.3.0/bin/scons-doc.py 0000644 0001750 0001750 00000100065 12114661557 017236 0 ustar dktrkranz dktrkranz #!/usr/bin/env python
#
# Copyright (c) 2010 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
# scons-doc.py - an SGML preprocessor for capturing SCons output
# and inserting it into examples in our DocBook
# documentation
#
# Synopsis:
#
# scons-doc [OPTIONS] [.in files]
#
# When no input files are given, the folder doc/user/* is searched for .in files.
#
# Available options:
#
# -d, --diff create examples for the .in file and output a unified
# diff against the related .xml file
# -r, --run create examples for the .in file, but do not change
# any files
# -s, --simple_diff use a simpler output for the diff mode (no unified
# diff!)
# -u, --update create examples for the .in file and update the
# related .xml file
#
# This script looks for some SGML tags that describe SCons example
# configurations and commands to execute in those configurations, and
# uses TestCmd.py to execute the commands and insert the output from
# those commands into the SGML that we output. This way, we can run a
# script and update all of our example documentation output without
# a lot of laborious by-hand checking.
#
# An "SCons example" looks like this, and essentially describes a set of
# input files (program source files as well as SConscript files):
#
#
#
# env = Environment()
# env.Program('foo')
#
#
# int main() { printf("foo.c\n"); }
#
#
#
# The contents within the tag will get written
# into a temporary directory whenever example output needs to be
# generated. By default, the contents are not inserted into text
# directly, unless you set the "printme" attribute on one or more files,
# in which case they will get inserted within a tag.
# This makes it easy to define the example at the appropriate
# point in the text where you intend to show the SConstruct file.
#
# Note that you should usually give the a "name"
# attribute so that you can refer to the example configuration later to
# run SCons and generate output.
#
# If you just want to show a file's contents without worry about running
# SCons, there's a shorter tag:
#
#
# env = Environment()
# env.Program('foo')
#
#
# This is essentially equivalent to ,
# but it's more straightforward.
#
# SCons output is generated from the following sort of tag:
#
#
# scons -Q foo
# scons -Q foo
#
#
# You tell it which example to use with the "example" attribute, and then
# give it a list of tags to execute. You can also
# supply an "os" tag, which specifies the type of operating system this
# example is intended to show; if you omit this, default value is "posix".
#
# The generated SGML will show the command line (with the appropriate
# command-line prompt for the operating system), execute the command in
# a temporary directory with the example files, capture the standard
# output from SCons, and insert it into the text as appropriate.
# Error output gets passed through to your error output so you
# can see if there are any problems executing the command.
#
import optparse
import os
import re
import sgmllib
import sys
import time
import glob
sys.path.append(os.path.join(os.getcwd(), 'QMTest'))
sys.path.append(os.path.join(os.getcwd(), 'build', 'QMTest'))
scons_py = os.path.join('bootstrap', 'src', 'script', 'scons.py')
if not os.path.exists(scons_py):
scons_py = os.path.join('src', 'script', 'scons.py')
scons_lib_dir = os.path.join(os.getcwd(), 'bootstrap', 'src', 'engine')
if not os.path.exists(scons_lib_dir):
scons_lib_dir = os.path.join(os.getcwd(), 'src', 'engine')
os.environ['SCONS_LIB_DIR'] = scons_lib_dir
import TestCmd
# The regular expression that identifies entity references in the
# standard sgmllib omits the underscore from the legal characters.
# Override it with our own regular expression that adds underscore.
sgmllib.entityref = re.compile('&([a-zA-Z][-_.a-zA-Z0-9]*)[^-_a-zA-Z0-9]')
# Classes for collecting different types of data we're interested in.
class DataCollector(object):
"""Generic class for collecting data between a start tag and end
tag. We subclass for various types of tags we care about."""
def __init__(self):
self.data = ""
def afunc(self, data):
self.data = self.data + data
class Example(DataCollector):
"""An SCons example. This is essentially a list of files that
will get written to a temporary directory to collect output
from one or more SCons runs."""
def __init__(self):
DataCollector.__init__(self)
self.files = []
self.dirs = []
class File(DataCollector):
"""A file, that will get written out to a temporary directory
for one or more SCons runs."""
def __init__(self, name):
DataCollector.__init__(self)
self.name = name
class Directory(DataCollector):
"""A directory, that will get created in a temporary directory
for one or more SCons runs."""
def __init__(self, name):
DataCollector.__init__(self)
self.name = name
class Output(DataCollector):
"""Where the command output goes. This is essentially
a list of commands that will get executed."""
def __init__(self):
DataCollector.__init__(self)
self.commandlist = []
class Command(DataCollector):
"""A tag for where the command output goes. This is essentially
a list of commands that will get executed."""
def __init__(self):
DataCollector.__init__(self)
self.output = None
Prompt = {
'posix' : '% ',
'win32' : 'C:\\>'
}
# The magick SCons hackery that makes this work.
#
# So that our examples can still use the default SConstruct file, we
# actually feed the following into SCons via stdin and then have it
# SConscript() the SConstruct file. This stdin wrapper creates a set
# of ToolSurrogates for the tools for the appropriate platform. These
# Surrogates print output like the real tools and behave like them
# without actually having to be on the right platform or have the right
# tool installed.
#
# The upshot: The wrapper transparently changes the world out from
# under the top-level SConstruct file in an example just so we can get
# the command output.
Stdin = """\
import os
import re
import SCons.Action
import SCons.Defaults
import SCons.Node.FS
platform = '%(osname)s'
Sep = {
'posix' : '/',
'win32' : '\\\\',
}[platform]
# Slip our own __str__() method into the EntryProxy class used to expand
# $TARGET{S} and $SOURCE{S} to translate the path-name separators from
# what's appropriate for the system we're running on to what's appropriate
# for the example system.
orig = SCons.Node.FS.EntryProxy
class MyEntryProxy(orig):
def __str__(self):
return str(self._subject).replace(os.sep, Sep)
SCons.Node.FS.EntryProxy = MyEntryProxy
# Slip our own RDirs() method into the Node.FS.File class so that the
# expansions of $_{CPPINC,F77INC,LIBDIR}FLAGS will have the path-name
# separators translated from what's appropriate for the system we're
# running on to what's appropriate for the example system.
orig_RDirs = SCons.Node.FS.File.RDirs
def my_RDirs(self, pathlist, orig_RDirs=orig_RDirs):
return [str(x).replace(os.sep, Sep) for x in orig_RDirs(self, pathlist)]
SCons.Node.FS.File.RDirs = my_RDirs
class Curry(object):
def __init__(self, fun, *args, **kwargs):
self.fun = fun
self.pending = args[:]
self.kwargs = kwargs.copy()
def __call__(self, *args, **kwargs):
if kwargs and self.kwargs:
kw = self.kwargs.copy()
kw.update(kwargs)
else:
kw = kwargs or self.kwargs
return self.fun(*self.pending + args, **kw)
def Str(target, source, env, cmd=""):
result = []
for cmd in env.subst_list(cmd, target=target, source=source):
result.append(' '.join(map(str, cmd)))
return '\\n'.join(result)
class ToolSurrogate(object):
def __init__(self, tool, variable, func, varlist):
self.tool = tool
if not isinstance(variable, list):
variable = [variable]
self.variable = variable
self.func = func
self.varlist = varlist
def __call__(self, env):
t = Tool(self.tool)
t.generate(env)
for v in self.variable:
orig = env[v]
try:
strfunction = orig.strfunction
except AttributeError:
strfunction = Curry(Str, cmd=orig)
# Don't call Action() through its global function name, because
# that leads to infinite recursion in trying to initialize the
# Default Environment.
env[v] = SCons.Action.Action(self.func,
strfunction=strfunction,
varlist=self.varlist)
def __repr__(self):
# This is for the benefit of printing the 'TOOLS'
# variable through env.Dump().
return repr(self.tool)
def Null(target, source, env):
pass
def Cat(target, source, env):
target = str(target[0])
f = open(target, "wb")
for src in map(str, source):
f.write(open(src, "rb").read())
f.close()
def CCCom(target, source, env):
target = str(target[0])
fp = open(target, "wb")
def process(source_file, fp=fp):
for line in open(source_file, "rb").readlines():
m = re.match(r'#include\s[<"]([^<"]+)[>"]', line)
if m:
include = m.group(1)
for d in [str(env.Dir('$CPPPATH')), '.']:
f = os.path.join(d, include)
if os.path.exists(f):
process(f)
break
elif line[:11] != "STRIP CCCOM":
fp.write(line)
for src in map(str, source):
process(src)
fp.write('debug = ' + ARGUMENTS.get('debug', '0') + '\\n')
fp.close()
public_class_re = re.compile('^public class (\S+)', re.MULTILINE)
def JavaCCom(target, source, env):
# This is a fake Java compiler that just looks for
# public class FooBar
# lines in the source file(s) and spits those out
# to .class files named after the class.
tlist = list(map(str, target))
not_copied = {}
for t in tlist:
not_copied[t] = 1
for src in map(str, source):
contents = open(src, "rb").read()
classes = public_class_re.findall(contents)
for c in classes:
for t in [x for x in tlist if x.find(c) != -1]:
open(t, "wb").write(contents)
del not_copied[t]
for t in not_copied.keys():
open(t, "wb").write("\\n")
def JavaHCom(target, source, env):
tlist = map(str, target)
slist = map(str, source)
for t, s in zip(tlist, slist):
open(t, "wb").write(open(s, "rb").read())
def JarCom(target, source, env):
target = str(target[0])
class_files = []
for src in map(str, source):
for dirpath, dirnames, filenames in os.walk(src):
class_files.extend([ os.path.join(dirpath, f)
for f in filenames if f.endswith('.class') ])
f = open(target, "wb")
for cf in class_files:
f.write(open(cf, "rb").read())
f.close()
# XXX Adding COLOR, COLORS and PACKAGE to the 'cc' varlist(s) by hand
# here is bogus. It's for the benefit of doc/user/command-line.in, which
# uses examples that want to rebuild based on changes to these variables.
# It would be better to figure out a way to do it based on the content of
# the generated command-line, or else find a way to let the example markup
# language in doc/user/command-line.in tell this script what variables to
# add, but that's more difficult than I want to figure out how to do right
# now, so let's just use the simple brute force approach for the moment.
ToolList = {
'posix' : [('cc', ['CCCOM', 'SHCCCOM'], CCCom, ['CCFLAGS', 'CPPDEFINES', 'COLOR', 'COLORS', 'PACKAGE']),
('link', ['LINKCOM', 'SHLINKCOM'], Cat, []),
('ar', ['ARCOM', 'RANLIBCOM'], Cat, []),
('tar', 'TARCOM', Null, []),
('zip', 'ZIPCOM', Null, []),
('BitKeeper', 'BITKEEPERCOM', Cat, []),
('CVS', 'CVSCOM', Cat, []),
('RCS', 'RCS_COCOM', Cat, []),
('SCCS', 'SCCSCOM', Cat, []),
('javac', 'JAVACCOM', JavaCCom, []),
('javah', 'JAVAHCOM', JavaHCom, []),
('jar', 'JARCOM', JarCom, []),
('rmic', 'RMICCOM', Cat, []),
],
'win32' : [('msvc', ['CCCOM', 'SHCCCOM', 'RCCOM'], CCCom, ['CCFLAGS', 'CPPDEFINES', 'COLOR', 'COLORS', 'PACKAGE']),
('mslink', ['LINKCOM', 'SHLINKCOM'], Cat, []),
('mslib', 'ARCOM', Cat, []),
('tar', 'TARCOM', Null, []),
('zip', 'ZIPCOM', Null, []),
('BitKeeper', 'BITKEEPERCOM', Cat, []),
('CVS', 'CVSCOM', Cat, []),
('RCS', 'RCS_COCOM', Cat, []),
('SCCS', 'SCCSCOM', Cat, []),
('javac', 'JAVACCOM', JavaCCom, []),
('javah', 'JAVAHCOM', JavaHCom, []),
('jar', 'JARCOM', JarCom, []),
('rmic', 'RMICCOM', Cat, []),
],
}
toollist = ToolList[platform]
filter_tools = '%(tools)s'.split()
if filter_tools:
toollist = [x for x in toollist if x[0] in filter_tools]
toollist = [ToolSurrogate(*t) for t in toollist]
toollist.append('install')
def surrogate_spawn(sh, escape, cmd, args, env):
pass
def surrogate_pspawn(sh, escape, cmd, args, env, stdout, stderr):
pass
SCons.Defaults.ConstructionEnvironment.update({
'PLATFORM' : platform,
'TOOLS' : toollist,
'SPAWN' : surrogate_spawn,
'PSPAWN' : surrogate_pspawn,
})
SConscript('SConstruct')
"""
# "Commands" that we will execute in our examples.
def command_scons(args, c, test, dict):
save_vals = {}
delete_keys = []
try:
ce = c.environment
except AttributeError:
pass
else:
for arg in c.environment.split():
key, val = arg.split('=')
try:
save_vals[key] = os.environ[key]
except KeyError:
delete_keys.append(key)
os.environ[key] = val
test.run(interpreter = sys.executable,
program = scons_py,
# We use ToolSurrogates to capture win32 output by "building"
# examples using a fake win32 tool chain. Suppress the
# warnings that come from the new revamped VS support so
# we can build doc on (Linux) systems that don't have
# Visual C installed.
arguments = '--warn=no-visual-c-missing -f - ' + ' '.join(args),
chdir = test.workpath('WORK'),
stdin = Stdin % dict)
os.environ.update(save_vals)
for key in delete_keys:
del(os.environ[key])
out = test.stdout()
out = out.replace(test.workpath('ROOT'), '')
out = out.replace(test.workpath('WORK/SConstruct'),
'/home/my/project/SConstruct')
lines = out.split('\n')
if lines:
while lines[-1] == '':
lines = lines[:-1]
#err = test.stderr()
#if err:
# sys.stderr.write(err)
return lines
def command_touch(args, c, test, dict):
if args[0] == '-t':
t = int(time.mktime(time.strptime(args[1], '%Y%m%d%H%M')))
times = (t, t)
args = args[2:]
else:
time.sleep(1)
times = None
for file in args:
if not os.path.isabs(file):
file = os.path.join(test.workpath('WORK'), file)
if not os.path.exists(file):
open(file, 'wb')
os.utime(file, times)
return []
def command_edit(args, c, test, dict):
try:
add_string = c.edit[:]
except AttributeError:
add_string = 'void edit(void) { ; }\n'
if add_string[-1] != '\n':
add_string = add_string + '\n'
for file in args:
if not os.path.isabs(file):
file = os.path.join(test.workpath('WORK'), file)
contents = open(file, 'rb').read()
open(file, 'wb').write(contents + add_string)
return []
def command_ls(args, c, test, dict):
def ls(a):
return [' '.join(sorted([x for x in os.listdir(a) if x[0] != '.']))]
if args:
l = []
for a in args:
l.extend(ls(test.workpath('WORK', a)))
return l
else:
return ls(test.workpath('WORK'))
def command_sleep(args, c, test, dict):
time.sleep(int(args[0]))
CommandDict = {
'scons' : command_scons,
'touch' : command_touch,
'edit' : command_edit,
'ls' : command_ls,
'sleep' : command_sleep,
}
def ExecuteCommand(args, c, t, dict):
try:
func = CommandDict[args[0]]
except KeyError:
func = lambda args, c, t, dict: []
return func(args[1:], c, t, dict)
class MySGML(sgmllib.SGMLParser):
"""A subclass of the standard Python sgmllib SGML parser.
This extends the standard sgmllib parser to recognize, and do cool
stuff with, the added tags that describe our SCons examples,
commands, and other stuff.
"""
def __init__(self, outfp):
sgmllib.SGMLParser.__init__(self)
self.examples = {}
self.afunclist = []
self.outfp = outfp
# The first set of methods here essentially implement pass-through
# handling of most of the stuff in an SGML file. We're really
# only concerned with the tags specific to SCons example processing,
# the methods for which get defined below.
def handle_data(self, data):
try:
f = self.afunclist[-1]
except IndexError:
self.outfp.write(data)
else:
f(data)
def handle_comment(self, data):
self.outfp.write('')
def handle_decl(self, data):
self.outfp.write('')
def unknown_starttag(self, tag, attrs):
try:
f = self.example.afunc
except AttributeError:
f = self.outfp.write
if not attrs:
f('<' + tag + '>')
else:
f('<' + tag)
for name, value in attrs:
f(' ' + name + '=' + '"' + value + '"')
f('>')
def unknown_endtag(self, tag):
self.outfp.write('' + tag + '>')
def unknown_entityref(self, ref):
self.outfp.write('&' + ref + ';')
def unknown_charref(self, ref):
self.outfp.write('' + ref + ';')
# Here is where the heavy lifting begins. The following methods
# handle the begin-end tags of our SCons examples.
def for_display(self, contents):
contents = contents.replace('__ROOT__', '')
contents = contents.replace('<', '<')
contents = contents.replace('>', '>')
return contents
def start_scons_example(self, attrs):
t = [t for t in attrs if t[0] == 'name']
if t:
name = t[0][1]
try:
e = self.examples[name]
except KeyError:
e = self.examples[name] = Example()
else:
e = Example()
for name, value in attrs:
setattr(e, name, value)
self.e = e
self.afunclist.append(e.afunc)
def end_scons_example(self):
e = self.e
files = [f for f in e.files if f.printme]
if files:
self.outfp.write('')
for f in files:
if f.printme:
i = len(f.data) - 1
while f.data[i] == ' ':
i = i - 1
output = self.for_display(f.data[:i+1])
self.outfp.write(output)
if e.data and e.data[0] == '\n':
e.data = e.data[1:]
self.outfp.write(e.data + '')
delattr(self, 'e')
self.afunclist = self.afunclist[:-1]
def start_file(self, attrs):
try:
e = self.e
except AttributeError:
self.error(" tag outside of ")
t = [t for t in attrs if t[0] == 'name']
if not t:
self.error("no name attribute found")
try:
e.prefix
except AttributeError:
e.prefix = e.data
e.data = ""
f = File(t[0][1])
f.printme = None
for name, value in attrs:
setattr(f, name, value)
e.files.append(f)
self.afunclist.append(f.afunc)
def end_file(self):
self.e.data = ""
self.afunclist = self.afunclist[:-1]
def start_directory(self, attrs):
try:
e = self.e
except AttributeError:
self.error(" tag outside of ")
t = [t for t in attrs if t[0] == 'name']
if not t:
self.error("no name attribute found")
try:
e.prefix
except AttributeError:
e.prefix = e.data
e.data = ""
d = Directory(t[0][1])
for name, value in attrs:
setattr(d, name, value)
e.dirs.append(d)
self.afunclist.append(d.afunc)
def end_directory(self):
self.e.data = ""
self.afunclist = self.afunclist[:-1]
def start_scons_example_file(self, attrs):
t = [t for t in attrs if t[0] == 'example']
if not t:
self.error("no example attribute found")
exname = t[0][1]
try:
e = self.examples[exname]
except KeyError:
self.error("unknown example name '%s'" % exname)
fattrs = [t for t in attrs if t[0] == 'name']
if not fattrs:
self.error("no name attribute found")
fname = fattrs[0][1]
f = [f for f in e.files if f.name == fname]
if not f:
self.error("example '%s' does not have a file named '%s'" % (exname, fname))
self.f = f[0]
def end_scons_example_file(self):
f = self.f
self.outfp.write('')
self.outfp.write(f.data + '')
delattr(self, 'f')
def start_scons_output(self, attrs):
t = [t for t in attrs if t[0] == 'example']
if not t:
self.error("no example attribute found")
exname = t[0][1]
try:
e = self.examples[exname]
except KeyError:
self.error("unknown example name '%s'" % exname)
# Default values for an example.
o = Output()
o.preserve = None
o.os = 'posix'
o.tools = ''
o.e = e
# Locally-set.
for name, value in attrs:
setattr(o, name, value)
self.o = o
self.afunclist.append(o.afunc)
def end_scons_output(self):
# The real raison d'etre for this script, this is where we
# actually execute SCons to fetch the output.
o = self.o
e = o.e
t = TestCmd.TestCmd(workdir='', combine=1)
if o.preserve:
t.preserve()
t.subdir('ROOT', 'WORK')
t.rootpath = t.workpath('ROOT').replace('\\', '\\\\')
for d in e.dirs:
dir = t.workpath('WORK', d.name)
if not os.path.exists(dir):
os.makedirs(dir)
for f in e.files:
i = 0
while f.data[i] == '\n':
i = i + 1
lines = f.data[i:].split('\n')
i = 0
while lines[0][i] == ' ':
i = i + 1
lines = [l[i:] for l in lines]
path = f.name.replace('__ROOT__', t.rootpath)
if not os.path.isabs(path):
path = t.workpath('WORK', path)
dir, name = os.path.split(path)
if dir and not os.path.exists(dir):
os.makedirs(dir)
content = '\n'.join(lines)
content = content.replace('__ROOT__', t.rootpath)
path = t.workpath('WORK', path)
t.write(path, content)
if hasattr(f, 'chmod'):
os.chmod(path, int(f.chmod, 0))
i = len(o.prefix)
while o.prefix[i-1] != '\n':
i = i - 1
self.outfp.write('' + o.prefix[:i])
p = o.prefix[i:]
# Regular expressions for making the doc output consistent,
# regardless of reported addresses or Python version.
# Massage addresses in object repr strings to a constant.
address_re = re.compile(r' at 0x[0-9a-fA-F]*\>')
# Massage file names in stack traces (sometimes reported as absolute
# paths) to a consistent relative path.
engine_re = re.compile(r' File ".*/src/engine/SCons/')
# Python 2.5 changed the stack trace when the module is read
# from standard input from read "... line 7, in ?" to
# "... line 7, in ".
file_re = re.compile(r'^( *File ".*", line \d+, in) \?$', re.M)
# Python 2.6 made UserList a new-style class, which changes the
# AttributeError message generated by our NodeList subclass.
nodelist_re = re.compile(r'(AttributeError:) NodeList instance (has no attribute \S+)')
for c in o.commandlist:
self.outfp.write(p + Prompt[o.os])
d = c.data.replace('__ROOT__', '')
self.outfp.write('' + d + '\n')
e = c.data.replace('__ROOT__', t.workpath('ROOT'))
args = e.split()
lines = ExecuteCommand(args, c, t, {'osname':o.os, 'tools':o.tools})
content = None
if c.output:
content = c.output
elif lines:
content = ( '\n' + p).join(lines)
if content:
content = address_re.sub(r' at 0x700000>', content)
content = engine_re.sub(r' File "bootstrap/src/engine/SCons/', content)
content = file_re.sub(r'\1 ', content)
content = nodelist_re.sub(r"\1 'NodeList' object \2", content)
content = self.for_display(content)
self.outfp.write(p + content + '\n')
if o.data[0] == '\n':
o.data = o.data[1:]
self.outfp.write(o.data + '')
delattr(self, 'o')
self.afunclist = self.afunclist[:-1]
def start_scons_output_command(self, attrs):
try:
o = self.o
except AttributeError:
self.error(" tag outside of ")
try:
o.prefix
except AttributeError:
o.prefix = o.data
o.data = ""
c = Command()
for name, value in attrs:
setattr(c, name, value)
o.commandlist.append(c)
self.afunclist.append(c.afunc)
def end_scons_output_command(self):
self.o.data = ""
self.afunclist = self.afunclist[:-1]
def start_sconstruct(self, attrs):
f = File('')
self.f = f
self.afunclist.append(f.afunc)
def end_sconstruct(self):
f = self.f
self.outfp.write('')
output = self.for_display(f.data)
self.outfp.write(output + '')
delattr(self, 'f')
self.afunclist = self.afunclist[:-1]
def process(filename, fout=sys.stdout):
if filename == '-':
f = sys.stdin
else:
try:
f = open(filename, 'r')
except EnvironmentError, e:
sys.stderr.write('%s: %s\n' % (filename, e))
return 1
data = f.read()
if f is not sys.stdin:
f.close()
if data.startswith(' 3 and version_tuple[3] != 'final':
if mode == 'develop':
version_tuple = version_tuple[:4] + ('yyyymmdd',)
else:
yyyy,mm,dd,_,_,_ = release_date
version_tuple = version_tuple[:4] + ((yyyy*100 + mm)*100 + dd,)
version_string = '.'.join(map(str, version_tuple))
if len(version_tuple) > 3:
version_type = version_tuple[3]
else:
version_type = 'final'
if DEBUG: print 'version string', version_string
if version_type not in ['alpha', 'beta', 'candidate', 'final']:
print("""ERROR: `%s' is not a valid release type in version tuple;
\tit must be one of alpha, beta, candidate, or final""" % version_type)
sys.exit(1)
try:
month_year = config['month_year']
except KeyError:
if version_type == 'alpha':
month_year = 'MONTH YEAR'
else:
month_year = time.strftime('%B %Y', release_date + (0,0,0))
if DEBUG: print 'month year', month_year
try:
copyright_years = config['copyright_years']
except KeyError:
copyright_years = ', '.join(map(str, list(range(2001, release_date[0] + 1))))
if DEBUG: print 'copyright years', copyright_years
class UpdateFile(object):
"""
XXX
"""
def __init__(self, file, orig = None):
'''
'''
if orig is None: orig = file
try:
self.content = open(orig, 'rU').read()
except IOError:
# Couldn't open file; don't try to write anything in __del__
self.file = None
raise
else:
self.file = file
if file == orig:
# so we can see if it changed
self.orig = self.content
else:
# pretend file changed
self.orig = ''
def sub(self, pattern, replacement, count = 1):
'''
XXX
'''
self.content = re.sub(pattern, replacement, self.content, count)
def replace_assign(self, name, replacement, count = 1):
'''
XXX
'''
self.sub('\n' + name + ' = .*', '\n' + name + ' = ' + replacement)
# Determine the pattern to match a version
_rel_types = '(alpha|beta|candidate|final)'
match_pat = '\d+\.\d+\.\d+\.' + _rel_types + '\.(\d+|yyyymmdd)'
match_rel = re.compile(match_pat)
def replace_version(self, replacement = version_string, count = 1):
'''
XXX
'''
self.content = self.match_rel.sub(replacement, self.content, count)
# Determine the release date and the pattern to match a date
# Mon, 05 Jun 2010 21:17:15 -0700
# NEW DATE WILL BE INSERTED HERE
if mode == 'develop':
new_date = 'NEW DATE WILL BE INSERTED HERE'
else:
min = (time.daylight and time.altzone or time.timezone)//60
hr = min//60
min = -(min%60 + hr*100)
new_date = (time.strftime('%a, %d %b %Y %X', release_date + (0,0,0))
+ ' %+.4d' % min)
_days = '(Sun|Mon|Tue|Wed|Thu|Fri|Sat)'
_months = '(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oce|Nov|Dec)'
match_date = _days+', \d\d '+_months+' \d\d\d\d \d\d:\d\d:\d\d [+-]\d\d\d\d'
match_date = re.compile(match_date)
def replace_date(self, replacement = new_date, count = 1):
'''
XXX
'''
self.content = self.match_date.sub(replacement, self.content, count)
def __del__(self):
'''
XXX
'''
if self.file is not None and self.content != self.orig:
print 'Updating ' + self.file + '...'
open(self.file, 'w').write(self.content)
if mode == 'post':
# Set up for the next release series.
if version_tuple[2]:
# micro release, increment micro value
minor = version_tuple[1]
micro = version_tuple[2] + 1
else:
# minor release, increment minor value
minor = version_tuple[1] + 1
micro = 0
new_tuple = (version_tuple[0], minor, micro, 'alpha', 0)
new_version = '.'.join(map(str, new_tuple[:4])) + '.yyyymmdd'
# Update ReleaseConfig
t = UpdateFile('ReleaseConfig')
if DEBUG: t.file = '/tmp/ReleaseConfig'
t.replace_assign('version_tuple', str(new_tuple))
# Update src/CHANGES.txt
t = UpdateFile(os.path.join('src', 'CHANGES.txt'))
if DEBUG: t.file = '/tmp/CHANGES.txt'
t.sub('(\nRELEASE .*)', r"""\nRELEASE VERSION/DATE TO BE FILLED IN LATER\n
From John Doe:\n
- Whatever John Doe did.\n
\1""")
# Update src/RELEASE.txt
t = UpdateFile(os.path.join('src', 'RELEASE.txt'),
os.path.join('template', 'RELEASE.txt'))
if DEBUG: t.file = '/tmp/RELEASE.txt'
t.replace_version(new_version)
# Update src/Announce.txt
t = UpdateFile(os.path.join('src', 'Announce.txt'))
if DEBUG: t.file = '/tmp/Announce.txt'
t.sub('\nRELEASE .*', '\nRELEASE VERSION/DATE TO BE FILLED IN LATER')
announce_pattern = """(
Please note the following important changes scheduled for the next
release:
)"""
announce_replace = (r"""\1
-- FEATURE THAT WILL CHANGE\n
Please note the following important changes since release """
+ '.'.join(map(str, version_tuple[:3])) + ':\n')
t.sub(announce_pattern, announce_replace)
# Write out the last update and exit
t = None
sys.exit()
# Update src/CHANGES.txt
t = UpdateFile(os.path.join('src', 'CHANGES.txt'))
if DEBUG: t.file = '/tmp/CHANGES.txt'
t.sub('\nRELEASE .*', '\nRELEASE ' + version_string + ' - ' + t.new_date)
# Update src/RELEASE.txt
t = UpdateFile(os.path.join('src', 'RELEASE.txt'))
if DEBUG: t.file = '/tmp/RELEASE.txt'
t.replace_version()
# Update src/Announce.txt
t = UpdateFile(os.path.join('src', 'Announce.txt'))
if DEBUG: t.file = '/tmp/Announce.txt'
t.sub('\nRELEASE .*', '\nRELEASE ' + version_string + ' - ' + t.new_date)
# Update SConstruct
t = UpdateFile('SConstruct')
if DEBUG: t.file = '/tmp/SConstruct'
t.replace_assign('month_year', repr(month_year))
t.replace_assign('copyright_years', repr(copyright_years))
t.replace_assign('default_version', repr(version_string))
# Update README
t = UpdateFile('README.rst')
if DEBUG: t.file = '/tmp/README.rst'
t.sub('-' + t.match_pat + '\.', '-' + version_string + '.', count = 0)
for suf in ['tar', 'win32', 'zip', 'rpm', 'exe', 'deb']:
t.sub('-(\d+\.\d+\.\d+)\.%s' % suf,
'-%s.%s' % (version_string, suf),
count = 0)
# Update QMTest/TestSCons.py
t = UpdateFile(os.path.join('QMTest', 'TestSCons.py'))
if DEBUG: t.file = '/tmp/TestSCons.py'
t.replace_assign('copyright_years', repr(copyright_years))
t.replace_assign('default_version', repr(version_string))
#??? t.replace_assign('SConsVersion', repr(version_string))
t.replace_assign('python_version_unsupported', str(unsupported_version))
t.replace_assign('python_version_deprecated', str(deprecated_version))
# Update Script/Main.py
t = UpdateFile(os.path.join('src', 'engine', 'SCons', 'Script', 'Main.py'))
if DEBUG: t.file = '/tmp/Main.py'
t.replace_assign('unsupported_python_version', str(unsupported_version))
t.replace_assign('deprecated_python_version', str(deprecated_version))
# Update doc/user/main.{in,xml}
docyears = ', '.join(map(str, iter(range(2004, release_date[0] + 1))))
t = UpdateFile(os.path.join('doc', 'user', 'main.in'))
if DEBUG: t.file = '/tmp/main.in'
## TODO debug these
#t.sub('[^<]*', '' + docyears + '')
#t.sub('[^<]*', '' + docyears + '')
t = UpdateFile(os.path.join('doc', 'user', 'main.xml'))
if DEBUG: t.file = '/tmp/main.xml'
## TODO debug these
#t.sub('[^<]*', '' + docyears + '')
#t.sub('[^<]*', '' + docyears + '')
# Write out the last update
t = None
# Local Variables:
# tab-width:4
# indent-tabs-mode:nil
# End:
# vim: set expandtab tabstop=4 shiftwidth=4:
scons-doc-2.3.0/bin/calibrate.py 0000644 0001750 0001750 00000006170 12114661557 017276 0 ustar dktrkranz dktrkranz #!/usr/bin/env python
#
# Copyright (c) 2009 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
from __future__ import division
import optparse
import os
import re
import subprocess
import sys
variable_re = re.compile('^VARIABLE: (.*)$', re.M)
elapsed_re = re.compile('^ELAPSED: (.*)$', re.M)
def main(argv=None):
if argv is None:
argv = sys.argv
parser = optparse.OptionParser(usage="calibrate.py [-h] [-p PACKAGE], [--min time] [--max time] timings/*/*-run.py")
parser.add_option('--min', type='float', default=9.5,
help="minimum acceptable execution time (default 9.5)")
parser.add_option('--max', type='float', default=10.00,
help="maximum acceptable execution time (default 10.00)")
parser.add_option('-p', '--package', type="string",
help="package type")
opts, args = parser.parse_args(argv[1:])
os.environ['TIMESCONS_CALIBRATE'] = '1'
for arg in args:
if len(args) > 1:
print arg + ':'
command = [sys.executable, 'runtest.py']
if opts.package:
command.extend(['-p', opts.package])
command.append(arg)
run = 1
good = 0
while good < 3:
p = subprocess.Popen(command,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT)
output = p.communicate()[0]
vm = variable_re.search(output)
em = elapsed_re.search(output)
try:
elapsed = float(em.group(1))
except AttributeError:
print output
raise
print "run %3d: %7.3f: %s" % (run, elapsed, ' '.join(vm.groups()))
if opts.min < elapsed and elapsed < opts.max:
good += 1
else:
good = 0
for v in vm.groups():
var, value = v.split('=', 1)
value = int((int(value) * opts.max) // elapsed)
os.environ[var] = str(value)
run += 1
return 0
if __name__ == "__main__":
sys.exit(main())
scons-doc-2.3.0/bin/xml_export-LICENSE 0000644 0001750 0001750 00000005234 12114661557 020202 0 ustar dktrkranz dktrkranz Copyright (c) 2002 Open Source Development Network, Inc. ("OSDN")
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
1. The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
2. Neither the names of VA Software Corporation, OSDN, SourceForge.net,
the SourceForge.net Site Documentation project, nor the names of its
contributors may be used to endorse or promote products derived from
the Software without specific prior written permission of OSDN.
3. The name and trademarks of copyright holders may NOT be used in
advertising or publicity pertaining to the Software without specific,
written prior permission. Title to copyright in the Software and
any associated documentation will at all times remain with copyright
holders.
4. If any files are modified, you must cause the modified files to carry
prominent notices stating that you changed the files and the date of
any change. We recommend that you provide URLs to the location from which
the code is derived.
5. Altered versions of the Software must be plainly marked as such, and
must not be misrepresented as being the original Software.
6. The origin of the Software must not be misrepresented; you must not
claim that you wrote the original Software. If you use the Software in a
product, an acknowledgment in the product documentation would be
appreciated but is not required.
7. The data files supplied as input to, or produced as output from,
the programs of the Software do not automatically fall under the
copyright of the Software, but belong to whomever generated them, and may
be sold commercially, and may be aggregated with the Software.
8. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE OR DOCUMENTATION.
This Software consists of contributions made by OSDN and many individuals
on behalf of OSDN. Specific attributions are listed in the accompanying
credits file.
scons-doc-2.3.0/bin/scons-cdist 0000644 0001750 0001750 00000017163 12114661557 017156 0 ustar dktrkranz dktrkranz #!/bin/sh
#
# Copyright (c) 2005 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
PROG=`basename $0`
NOARGFLAGS="afhlnqrstz"
ARGFLAGS="p:"
ALLFLAGS="${NOARGFLAGS}${ARGFLAGS}"
USAGE="Usage: ${PROG} [-${NOARGFLAGS}] [-p project] change"
HELP="$USAGE
-a Update the latest Aegis baseline (aedist) file.
-f Force update, skipping up-front sanity check.
-h Print this help message and exit.
-l Update the local CVS repository.
-n Don't execute, just echo commands.
-p project Set the Aegis project.
-q Quiet, don't print commands before executing them.
-r Rsync the Aegis repository to SourceForge.
-s Update the sourceforge.net CVS repository.
-t Update the tigris.org CVS repository.
-z Update the latest .tar.gz and .zip files.
"
DO=""
PRINT="echo"
EXECUTE="eval"
SANITY_CHECK="yes"
while getopts $ALLFLAGS FLAG; do
case $FLAG in
a | l | r | s | t | z )
DO="${DO}${FLAG}"
;;
f )
SANITY_CHECK="no"
;;
h )
echo "${HELP}"
exit 0
;;
n )
EXECUTE=":"
;;
p )
AEGIS_PROJECT="${OPTARG}"
;;
q )
PRINT=":"
;;
* )
echo "FLAG = ${FLAG}" >&2
echo "${USAGE}" >&2
exit 1
;;
esac
done
shift `expr ${OPTIND} - 1`
if test "X$1" = "X"; then
echo "${USAGE}" >&2
exit 1
fi
if test "X${AEGIS_PROJECT}" = "X"; then
echo "$PROG: No AEGIS_PROJECT set." >&2
echo "${USAGE}" >&2
exit 1
fi
if test "X$DO" = "X"; then
DO="alrstz"
fi
cmd()
{
$PRINT "$*"
$EXECUTE "$*"
}
CHANGE=$1
if test "X${SANITY_CHECK}" = "Xyes"; then
SCM="cvs"
SCMROOT="/home/scons/CVSROOT/scons"
DELTA=`aegis -l -ter cd ${CHANGE} | sed -n 's/.*, Delta \([0-9]*\)\./\1/p'`
if test "x${DELTA}" = "x"; then
echo "${PROG}: Could not find delta for change ${CHANGE}." >&2
echo "Has this finished integrating? Change ${CHANGE} not distributed." >&2
exit 1
fi
PREV_DELTA=`expr ${DELTA} - 1`
COMMAND="scons-scmcheck -D ${PREV_DELTA} -d q -p ${AEGIS_PROJECT} -s ${SCM} ${SCMROOT}"
$PRINT "${COMMAND}"
OUTPUT=`${COMMAND}`
if test "X${OUTPUT}" != "X"; then
echo "${PROG}: ${SCMROOT} is not up to date:" >&2
echo "${OUTPUT}" >& 2
echo "Did you skip any changes? Change ${CHANGE} not distributed." >&2
exit 1
fi
fi
if test X$EXECUTE != "X:" -a "X$SSH_AGENT_PID" = "X"; then
eval `ssh-agent`
ssh-add
trap 'eval `ssh-agent -k`; exit' 0 1 2 3 15
fi
cd
BASELINE=`aesub -p ${AEGIS_PROJECT} -c ${CHANGE} '${Project trunk_name}'`
TMPBLAE="/tmp/${BASELINE}.ae"
TMPCAE="/tmp/${AEGIS_PROJECT}.C${CHANGE}.ae"
# Original values for SourceForge.
#SFLOGIN="stevenknight"
#SFHOST="scons.sourceforge.net"
#SFDEST="/home/groups/s/sc/scons/htdocs"
SCONSLOGIN="scons"
SCONSHOST="manam.pair.com"
#SCONSDEST="public_html/production"
SCONSDEST="public_ftp"
#
# Copy the baseline .ae to the constant location on SourceForge.
#
case "${DO}" in
*a* )
cmd "aedist -s -bl -p ${AEGIS_PROJECT} > ${TMPBLAE}"
cmd "scp ${TMPBLAE} ${SCONSLOGIN}@${SCONSHOST}:${SCONSDEST}/${BASELINE}.ae"
cmd "rm ${TMPBLAE}"
;;
esac
#
# Copy the latest .tar.gz and .zip files to the constant location on
# SourceForge.
#
case "${DO}" in
*z* )
BUILD_DIST=`aegis -p ${AEGIS_PROJECT} -cd -bl`/build/dist
SCONS_SRC_TAR_GZ=`echo ${AEGIS_PROJECT} | sed 's/scons./scons-src-/'`*.tar.gz
SCONS_SRC_ZIP=`echo ${AEGIS_PROJECT} | sed 's/scons./scons-src-/'`*.zip
cmd "scp ${BUILD_DIST}/${SCONS_SRC_TAR_GZ} ${SCONSLOGIN}@${SCONSHOST}:${SCONSDEST}/scons-src-latest.tar.gz"
cmd "scp ${BUILD_DIST}/${SCONS_SRC_ZIP} ${SCONSLOGIN}@${SCONSHOST}:${SCONSDEST}/scons-src-latest.zip"
esac
#
# Sync Aegis tree with SourceForge.
#
# Cribbed and modified from Peter Miller's same-named script in
# /home/groups/a/ae/aegis/aegis at SourceForge.
#
# Guide to what this does with rsync:
#
# --rsh=ssh use ssh for the transfer
# -l copy symlinks as symlinks
# -p preserve permissions
# -r recursive
# -t preserve times
# -z compress data
# --stats file transfer statistics
# --exclude exclude files matching the pattern
# --delete delete files that don't exist locally
# --delete-excluded delete files that match the --exclude patterns
# --progress show progress during the transfer
# -v verbose
#
# We no longer use the --stats option.
#
case "${DO}" in
*r* )
LOCAL=/home/scons/scons
REMOTE=/home/groups/s/sc/scons/scons
cmd "/usr/bin/rsync --rsh='ssh -l stevenknight' \
-l -p -r -t -z \
--exclude build \
--exclude '*,D' \
--exclude '*.pyc' \
--exclude aegis.log \
--exclude '.sconsign*' \
--delete --delete-excluded \
--progress -v \
${LOCAL}/. scons.sourceforge.net:${REMOTE}/."
;;
esac
#
# Sync the CVS tree with the local repository.
#
case "${DO}" in
*l* )
(
export CVSROOT=/home/scons/CVSROOT/scons
#cmd "ae2cvs -X -aegis -p ${AEGIS_PROJECT} -c ${CHANGE} -u $HOME/SCons/baldmt.com/scons"
cmd "ae-cvs-ci ${AEGIS_PROJECT} ${CHANGE}"
)
;;
esac
#
# Sync the Subversion tree with Tigris.org.
#
case "${DO}" in
*t* )
(
SVN=http://scons.tigris.org/svn/scons
case ${AEGIS_PROJECT} in
scons.0.96 )
SVN_URL=${SVN}/branches/core
;;
scons.0.96.513 )
SVN_URL=${SVN}/branches/sigrefactor
;;
* )
echo "$PROG: Don't know SVN branch for '${AEGIS_PROJECT}'" >&2
exit 1
;;
esac
SVN_CO_FLAGS="--username stevenknight"
#cmd "ae2cvs -X -aegis -p ${AEGIS_PROJECT} -c ${CHANGE} -u $HOME/SCons/tigris.org/scons"
cmd "ae-svn-ci ${AEGIS_PROJECT} ${CHANGE} ${SVN_URL} ${SVN_CO_FLAGS}"
)
;;
esac
#
# Sync the CVS tree with SourceForge.
#
case "${DO}" in
*s* )
(
export CVS_RSH=ssh
export CVSROOT=:ext:stevenknight@scons.cvs.sourceforge.net:/cvsroot/scons
#cmd "ae2cvs -X -aegis -p ${AEGIS_PROJECT} -c ${CHANGE} -u $HOME/SCons/sourceforge.net/scons"
cmd "ae-cvs-ci ${AEGIS_PROJECT} ${CHANGE}"
)
;;
esac
#
# Send the change .ae to the scons-aedist mailing list
#
# The subject requires editing by hand...
#
#aedist -s -p ${AEGIS_PROJECT} ${CHANGE} > ${TMPCAE}
#aegis -l -p ${AEGIS_PROJECT} -c ${CHANGE} cd |
# pine -attach_and_delete ${TMPCAE} scons-aedist@lists.sourceforge.net
scons-doc-2.3.0/bin/scons_dev_master.py 0000644 0001750 0001750 00000013207 12114661557 020705 0 ustar dktrkranz dktrkranz #!/bin/sh
#
# A script for turning a generic Ubuntu system into a master for
# SCons development.
import getopt
import sys
from Command import CommandRunner, Usage
INITIAL_PACKAGES = [
'subversion',
]
INSTALL_PACKAGES = [
'wget',
]
PYTHON_PACKAGES = [
'g++',
'gcc',
'make',
'zlib1g-dev',
]
BUILDING_PACKAGES = [
'docbook',
'docbook-dsssl',
'docbook-utils',
'docbook-xml',
'groff-base',
'jade',
'jadetex',
'man2html',
'python-epydoc',
'rpm',
'sp',
'tar',
# additional packages that Bill Deegan's web page suggests
#'docbook-to-man',
#'docbook-xsl',
#'docbook2x',
#'tetex-bin',
#'tetex-latex',
# for ubuntu 9.10
# 'texlive-lang-french'
]
DOCUMENTATION_PACKAGES = [
'docbook-doc',
'epydoc-doc',
'gcc-doc',
'pkg-config',
'python-doc',
'sun-java5-doc',
'sun-java6-doc',
'swig-doc',
'texlive-doc',
]
TESTING_PACKAGES = [
'bison',
'cssc',
'cvs',
'flex',
'g++',
'gcc',
'gcj',
'ghostscript',
# 'libgcj7-dev',
'm4',
'openssh-client',
'openssh-server',
'python-profiler',
'python-all-dev',
'rcs',
'rpm',
# 'sun-java5-jdk',
'sun-java6-jdk',
'swig',
'texlive-base-bin',
'texlive-extra-utils',
'texlive-latex-base',
'texlive-latex-extra',
'zip',
]
BUILDBOT_PACKAGES = [
'buildbot',
'cron',
]
default_args = [
'upgrade',
'checkout',
'building',
'testing',
'python-versions',
'scons-versions',
]
def main(argv=None):
if argv is None:
argv = sys.argv
short_options = 'hnqy'
long_options = ['help', 'no-exec', 'password=', 'quiet', 'username=',
'yes', 'assume-yes']
helpstr = """\
Usage: scons_dev_master.py [-hnqy] [--password PASSWORD] [--username USER]
[ACTIONS ...]
ACTIONS (in default order):
upgrade Upgrade the system
checkout Check out SCons
building Install packages for building SCons
testing Install packages for testing SCons
scons-versions Install versions of SCons
python-versions Install versions of Python
ACTIONS (optional):
buildbot Install packages for running BuildBot
"""
scons_url = 'http://scons.tigris.org/svn/scons/trunk'
sudo = 'sudo'
password = '""'
username = 'guest'
yesflag = ''
try:
try:
opts, args = getopt.getopt(argv[1:], short_options, long_options)
except getopt.error, msg:
raise Usage(msg)
for o, a in opts:
if o in ('-h', '--help'):
print helpstr
sys.exit(0)
elif o in ('-n', '--no-exec'):
CommandRunner.execute = CommandRunner.do_not_execute
elif o in ('--password'):
password = a
elif o in ('-q', '--quiet'):
CommandRunner.display = CommandRunner.do_not_display
elif o in ('--username'):
username = a
elif o in ('-y', '--yes', '--assume-yes'):
yesflag = o
except Usage, err:
sys.stderr.write(str(err.msg) + '\n')
sys.stderr.write('use -h to get help\n')
return 2
if not args:
args = default_args
initial_packages = ' '.join(INITIAL_PACKAGES)
install_packages = ' '.join(INSTALL_PACKAGES)
building_packages = ' '.join(BUILDING_PACKAGES)
testing_packages = ' '.join(TESTING_PACKAGES)
buildbot_packages = ' '.join(BUILDBOT_PACKAGES)
python_packages = ' '.join(PYTHON_PACKAGES)
cmd = CommandRunner(locals())
for arg in args:
if arg == 'upgrade':
cmd.run('%(sudo)s apt-get %(yesflag)s upgrade')
elif arg == 'checkout':
cmd.run('%(sudo)s apt-get %(yesflag)s install %(initial_packages)s')
cmd.run('svn co --username guest --password "" %(scons_url)s')
elif arg == 'building':
cmd.run('%(sudo)s apt-get %(yesflag)s install %(building_packages)s')
elif arg == 'testing':
cmd.run('%(sudo)s apt-get %(yesflag)s install %(testing_packages)s')
elif arg == 'buildbot':
cmd.run('%(sudo)s apt-get %(yesflag)s install %(buildbot_packages)s')
elif arg == 'python-versions':
if install_packages:
cmd.run('%(sudo)s apt-get %(yesflag)s install %(install_packages)s')
install_packages = None
cmd.run('%(sudo)s apt-get %(yesflag)s install %(python_packages)s')
try:
import install_python
except ImportError:
msg = 'Could not import install_python; skipping python-versions.\n'
sys.stderr.write(msg)
else:
install_python.main(['install_python.py', '-a'])
elif arg == 'scons-versions':
if install_packages:
cmd.run('%(sudo)s apt-get %(yesflag)s install %(install_packages)s')
install_packages = None
try:
import install_scons
except ImportError:
msg = 'Could not import install_scons; skipping scons-versions.\n'
sys.stderr.write(msg)
else:
install_scons.main(['install_scons.py', '-a'])
else:
msg = '%s: unknown argument %s\n'
sys.stderr.write(msg % (argv[0], repr(arg)))
sys.exit(1)
if __name__ == "__main__":
sys.exit(main())
# Local Variables:
# tab-width:4
# indent-tabs-mode:nil
# End:
# vim: set expandtab tabstop=4 shiftwidth=4:
scons-doc-2.3.0/bin/scons-proc.py 0000644 0001750 0001750 00000042574 12114661557 017446 0 ustar dktrkranz dktrkranz #!/usr/bin/env python
#
# Process a list of Python and/or XML files containing SCons documentation.
#
# This script creates formatted lists of the Builders, functions, Tools
# or construction variables documented in the specified XML files.
#
# Dependening on the options, the lists are output in either
# DocBook-formatted generated XML files containing the summary text
# and/or .mod files contining the ENTITY definitions for each item,
# or in man-page-formatted output.
#
import getopt
import os
import re
import string
import sys
import xml.sax
try:
from io import StringIO # usable as of 2.6; takes unicode only
except ImportError:
# No 'io' module or no StringIO in io
exec('from cStringIO import StringIO')
import SConsDoc
base_sys_path = [os.getcwd() + '/build/test-tar-gz/lib/scons'] + sys.path
helpstr = """\
Usage: scons-proc.py [--man|--xml]
[-b file(s)] [-f file(s)] [-t file(s)] [-v file(s)]
[infile ...]
Options:
-b file(s) dump builder information to the specified file(s)
-f file(s) dump function information to the specified file(s)
-t file(s) dump tool information to the specified file(s)
-v file(s) dump variable information to the specified file(s)
--man print info in man page format, each -[btv] argument
is a single file name
--xml (default) print info in SML format, each -[btv] argument
is a pair of comma-separated .gen,.mod file names
"""
opts, args = getopt.getopt(sys.argv[1:],
"b:f:ht:v:",
['builders=', 'help',
'man', 'xml', 'tools=', 'variables='])
buildersfiles = None
functionsfiles = None
output_type = '--xml'
toolsfiles = None
variablesfiles = None
for o, a in opts:
if o in ['-b', '--builders']:
buildersfiles = a
elif o in ['-f', '--functions']:
functionsfiles = a
elif o in ['-h', '--help']:
sys.stdout.write(helpstr)
sys.exit(0)
elif o in ['--man', '--xml']:
output_type = o
elif o in ['-t', '--tools']:
toolsfiles = a
elif o in ['-v', '--variables']:
variablesfiles = a
h = SConsDoc.SConsDocHandler()
saxparser = xml.sax.make_parser()
saxparser.setContentHandler(h)
saxparser.setErrorHandler(h)
xml_preamble = """\
"""
xml_postamble = """\
"""
for f in args:
_, ext = os.path.splitext(f)
if ext == '.py':
dir, _ = os.path.split(f)
if dir:
sys.path = [dir] + base_sys_path
module = SConsDoc.importfile(f)
h.set_file_info(f, len(xml_preamble.split('\n')))
try:
content = module.__scons_doc__
except AttributeError:
content = None
else:
del module.__scons_doc__
else:
h.set_file_info(f, len(xml_preamble.split('\n')))
content = open(f).read()
if content:
content = content.replace('&', '&')
# Strip newlines after comments so they don't turn into
# spurious paragraph separators.
content = content.replace('-->\n', '-->')
input = xml_preamble + content + xml_postamble
try:
saxparser.parse(StringIO(unicode(input)))
except:
sys.stderr.write("error in %s\n" % f)
raise
Warning = """\
"""
Regular_Entities_Header = """\
"""
Link_Entities_Header = """\
"""
class SCons_XML(object):
def __init__(self, entries, **kw):
self.values = entries
for k, v in kw.items():
setattr(self, k, v)
def fopen(self, name):
if name == '-':
return sys.stdout
return open(name, 'w')
class SCons_XML_to_XML(SCons_XML):
def write(self, files):
gen, mod = files.split(',')
g.write_gen(gen)
g.write_mod(mod)
def write_gen(self, filename):
if not filename:
return
f = self.fopen(filename)
for v in self.values:
f.write('\n\n' %
(v.prefix, v.idfunc()))
f.write('%s\n' % v.xml_term())
f.write('\n')
for chunk in v.summary.body:
f.write(str(chunk))
if v.sets:
s = ['&cv-link-%s;' % x for x in v.sets]
f.write('\n')
f.write('Sets: ' + ', '.join(s) + '.\n')
f.write('\n')
if v.uses:
u = ['&cv-link-%s;' % x for x in v.uses]
f.write('\n')
f.write('Uses: ' + ', '.join(u) + '.\n')
f.write('\n')
f.write('\n')
f.write('\n')
def write_mod(self, filename):
description = self.values[0].description
if not filename:
return
f = self.fopen(filename)
f.write(Warning)
f.write('\n')
f.write(Regular_Entities_Header % description)
f.write('\n')
for v in self.values:
f.write('%s%s>">\n' %
(v.prefix, v.idfunc(),
v.tag, v.entityfunc(), v.tag))
if self.env_signatures:
f.write('\n')
for v in self.values:
f.write('env.%s%s>">\n' %
(v.prefix, v.idfunc(),
v.tag, v.entityfunc(), v.tag))
f.write('\n')
f.write(Warning)
f.write('\n')
f.write(Link_Entities_Header % description)
f.write('\n')
for v in self.values:
f.write('<%s>%s%s>\'>\n' %
(v.prefix, v.idfunc(),
v.prefix, v.idfunc(),
v.tag, v.entityfunc(), v.tag))
if self.env_signatures:
f.write('\n')
for v in self.values:
f.write('<%s>env.%s%s>\'>\n' %
(v.prefix, v.idfunc(),
v.prefix, v.idfunc(),
v.tag, v.entityfunc(), v.tag))
f.write('\n')
f.write(Warning)
class SCons_XML_to_man(SCons_XML):
def write(self, filename):
"""
Converts the contents of the specified filename from DocBook XML
to man page macros.
This does not do an intelligent job. In particular, it doesn't
actually use the structured nature of XML to handle arbitrary
input. Instead, we're using text replacement and regular
expression substitutions to convert observed patterns into the
macros we want. To the extent that we're relatively consistent
with our input .xml, this works, but could easily break if handed
input that doesn't match these specific expectations.
"""
if not filename:
return
f = self.fopen(filename)
chunks = []
for v in self.values:
chunks.extend(v.man_separator())
chunks.extend(v.initial_man_chunks())
chunks.extend(list(map(str, v.summary.body)))
body = ''.join(chunks)
# Simple transformation of examples into our defined macros for those.
body = body.replace('', '.ES')
body = body.replace('', '.EE')
# Replace groupings of tags and surrounding newlines
# with single blank lines.
body = body.replace('\n\n\n', '\n\n')
body = body.replace('\n', '')
body = body.replace('', '\n')
body = body.replace('\n', '')
# Convert and its child tags.
body = body.replace('\n', '.RS 10\n')
# Handling needs to be rationalized and made
# consistent. Right now, the values map to arbitrary,
# ad-hoc idioms in the current man page.
body = re.compile(r'\n([^<]*)\n\n').sub(r'.TP 6\n.B \1\n', body)
body = re.compile(r'\n([^<]*)\n\n').sub(r'.IP \1\n', body)
body = re.compile(r'\n([^<]*)\n\n').sub(r'.HP 6\n.B \1\n', body)
body = body.replace('\n', '')
body = body.replace('\n', '')
body = body.replace('\n', '.RE\n')
# Get rid of unnecessary .IP macros, and unnecessary blank lines
# in front of .IP macros.
body = re.sub(r'\.EE\n\n+(?!\.IP)', '.EE\n.IP\n', body)
body = body.replace('\n.EE\n.IP\n.ES\n', '\n.EE\n\n.ES\n')
body = body.replace('\n.IP\n\'\\"', '\n\n\'\\"')
# Convert various named entities and tagged names to nroff
# in-line font conversions (\fB, \fI, \fP).
body = re.sub('&(scons|SConstruct|SConscript|Dir|jar|Make|lambda);',
r'\\fB\1\\fP', body)
body = re.sub('&(TARGET|TARGETS|SOURCE|SOURCES);', r'\\fB$\1\\fP', body)
body = re.sub('&(target|source);', r'\\fI\1\\fP', body)
body = re.sub('&b(-link)?-([^;]*);', r'\\fB\2\\fP()', body)
body = re.sub('&cv(-link)?-([^;]*);', r'\\fB$\2\\fP', body)
body = re.sub('&f(-link)?-env-([^;]*);', r'\\fBenv.\2\\fP()', body)
body = re.sub('&f(-link)?-([^;]*);', r'\\fB\2\\fP()', body)
body = re.sub(r'<(application|command|envar|filename|function|literal|option)>([^<]*)\1>',
r'\\fB\2\\fP', body)
body = re.sub(r'<(classname|emphasis|varname)>([^<]*)\1>',
r'\\fI\2\\fP', body)
# Convert groupings of font conversions (\fB, \fI, \fP) to
# man page .B, .BR, .I, .IR, .R, .RB and .RI macros.
body = re.compile(r'^\\f([BI])([^\\]* [^\\]*)\\fP\s*$', re.M).sub(r'.\1 "\2"', body)
body = re.compile(r'^\\f([BI])(.*)\\fP\s*$', re.M).sub(r'.\1 \2', body)
body = re.compile(r'^\\f([BI])(.*)\\fP(\S+)$', re.M).sub(r'.\1R \2 \3', body)
body = re.compile(r'^(\.B)( .*)\\fP(.*)\\fB(.*)$', re.M).sub(r'\1R\2 \3 \4', body)
body = re.compile(r'^(\.B)R?( .*)\\fP(.*)\\fI(.*)$', re.M).sub(r'\1I\2\3 \4', body)
body = re.compile(r'^(\.I)( .*)\\fP\\fB(.*)\\fP\\fI(.*)$', re.M).sub(r'\1R\2 \3 \4', body)
body = re.compile(r'^(\S+)\\f([BI])(.*)\\fP$', re.M).sub(r'.R\2 \1 \3', body)
body = re.compile(r'^(\S+)\\f([BI])(.*)\\fP([^\s\\]+)$', re.M).sub(r'.R\2 \1 \3 \4', body)
body = re.compile(r'^(\.R[BI].*[\S])\s+$;', re.M).sub(r'\1', body)
# Convert < and > entities to literal < and > characters.
body = body.replace('<', '<')
body = body.replace('>', '>')
# Backslashes. Oh joy.
body = re.sub(r'\\(?=[^f])', r'\\\\', body)
body = re.compile("^'\\\\\\\\", re.M).sub("'\\\\", body)
body = re.compile(r'^\.([BI]R?) ([^"]\S*\\\\\S+[^"])$', re.M).sub(r'.\1 "\2"', body)
# Put backslashes in front of various hyphens that need
# to be long em-dashes.
body = re.compile(r'^\.([BI]R?) --', re.M).sub(r'.\1 \-\-', body)
body = re.compile(r'^\.([BI]R?) -', re.M).sub(r'.\1 \-', body)
body = re.compile(r'\\f([BI])-', re.M).sub(r'\\f\1\-', body)
f.write(body)
class Proxy(object):
def __init__(self, subject):
"""Wrap an object as a Proxy object"""
self.__subject = subject
def __getattr__(self, name):
"""Retrieve an attribute from the wrapped object. If the named
attribute doesn't exist, AttributeError is raised"""
return getattr(self.__subject, name)
def get(self):
"""Retrieve the entire wrapped object"""
return self.__subject
def __cmp__(self, other):
if issubclass(other.__class__, self.__subject.__class__):
return cmp(self.__subject, other)
return cmp(self.__dict__, other.__dict__)
class SConsThing(Proxy):
def idfunc(self):
return self.name
def xml_term(self):
return '%s' % self.name
class Builder(SConsThing):
description = 'builder'
prefix = 'b-'
tag = 'function'
def xml_term(self):
return ('<%s>%s()%s>\n<%s>env.%s()%s>' %
(self.tag, self.name, self.tag, self.tag, self.name, self.tag))
def entityfunc(self):
return self.name
def man_separator(self):
return ['\n', "'\\" + '"'*69 + '\n']
def initial_man_chunks(self):
return [ '.IP %s()\n.IP env.%s()\n' % (self.name, self.name) ]
class Function(SConsThing):
description = 'function'
prefix = 'f-'
tag = 'function'
def args_to_xml(self, arg):
s = ''.join(arg.body).strip()
result = []
for m in re.findall('([a-zA-Z/_]+=?|[^a-zA-Z/_]+)', s):
if m[0] in string.letters:
if m[-1] == '=':
result.append('%s=' % m[:-1])
else:
result.append('%s' % m)
else:
result.append(m)
return ''.join(result)
def xml_term(self):
try:
arguments = self.arguments
except AttributeError:
arguments = ['()']
result = ['']
for arg in arguments:
try:
signature = arg.signature
except AttributeError:
signature = "both"
s = self.args_to_xml(arg)
if signature in ('both', 'global'):
result.append('%s%s\n' % (self.name, s)) #
if signature in ('both', 'env'):
result.append('env.%s%s' % (self.name, s))
result.append('')
return ''.join(result)
def entityfunc(self):
return self.name
def man_separator(self):
return ['\n', "'\\" + '"'*69 + '\n']
def args_to_man(self, arg):
"""Converts the contents of an tag, which
specifies a function's calling signature, into a series
of tokens that alternate between literal tokens
(to be displayed in roman or bold face) and variable
names (to be displayed in italics).
This is complicated by the presence of Python "keyword=var"
arguments, where "keyword=" should be displayed literally,
and "var" should be displayed in italics. We do this by
detecting the keyword= var portion and appending it to the
previous string, if any.
"""
s = ''.join(arg.body).strip()
result = []
for m in re.findall('([a-zA-Z/_]+=?|[^a-zA-Z/_]+)', s):
if m[-1] == '=' and result:
if result[-1][-1] == '"':
result[-1] = result[-1][:-1] + m + '"'
else:
result[-1] += m
else:
if ' ' in m:
m = '"%s"' % m
result.append(m)
return ' '.join(result)
def initial_man_chunks(self):
try:
arguments = self.arguments
except AttributeError:
arguments = ['()']
result = []
for arg in arguments:
try:
signature = arg.signature
except AttributeError:
signature = "both"
s = self.args_to_man(arg)
if signature in ('both', 'global'):
result.append('.TP\n.RI %s%s\n' % (self.name, s))
if signature in ('both', 'env'):
result.append('.TP\n.IR env .%s%s\n' % (self.name, s))
return result
class Tool(SConsThing):
description = 'tool'
prefix = 't-'
tag = 'literal'
def idfunc(self):
return self.name.replace('+', 'X')
def entityfunc(self):
return self.name
def man_separator(self):
return ['\n']
def initial_man_chunks(self):
return ['.IP %s\n' % self.name]
class Variable(SConsThing):
description = 'construction variable'
prefix = 'cv-'
tag = 'envar'
def entityfunc(self):
return '$' + self.name
def man_separator(self):
return ['\n']
def initial_man_chunks(self):
return ['.IP %s\n' % self.name]
if output_type == '--man':
processor_class = SCons_XML_to_man
elif output_type == '--xml':
processor_class = SCons_XML_to_XML
else:
sys.stderr.write("Unknown output type '%s'\n" % output_type)
sys.exit(1)
if buildersfiles:
g = processor_class([ Builder(b) for b in sorted(h.builders.values()) ],
env_signatures=True)
g.write(buildersfiles)
if functionsfiles:
g = processor_class([ Function(b) for b in sorted(h.functions.values()) ],
env_signatures=True)
g.write(functionsfiles)
if toolsfiles:
g = processor_class([ Tool(t) for t in sorted(h.tools.values()) ],
env_signatures=False)
g.write(toolsfiles)
if variablesfiles:
g = processor_class([ Variable(v) for v in sorted(h.cvars.values()) ],
env_signatures=False)
g.write(variablesfiles)
# Local Variables:
# tab-width:4
# indent-tabs-mode:nil
# End:
# vim: set expandtab tabstop=4 shiftwidth=4:
scons-doc-2.3.0/bin/xmlagenda.py 0000755 0001750 0001750 00000007156 12114661557 017320 0 ustar dktrkranz dktrkranz #!/usr/bin/env python
# Query the scons.tigris.org database for the issues of interest.
# The typical triage query is found on http://www.scons.org/wiki/BugParty
# Download the issues from Issuezilla as XML; this creates a file
# named 'issues.xml'. Run this script in the dir containing
# issues.xml (or pass full path as arg to this script) to translate
# 'issues.xml' into a CSV file named 'editlist.csv'. Upload the CSV
# into a Google spreadsheet.
# In the spreadsheet:
# Select all the columns and pick "align-->top"
# Select the ID and votes columns and pick "align-->right"
# Select the priority column and pick "align-->center"
# Select the first row and click on the "bold" button
# Grab the lines between the column headers to adjust the column widths
# Grab the sort bar on the far left (just above the "1" for row one)
# and move it down one row. (Row one becomes a floating header)
# Voila!
# The team members
# FIXME: These names really should be external to this script
team = sorted('Steven Gary Greg Ken Jim Bill Jason Dirk Anatoly'.split())
# The elements to be picked out of the issue
PickList = [
# sort key -- these are used to sort the entry
'target_milestone', 'priority', 'votes_desc', 'creation_ts',
# payload -- these are displayed
'issue_id', 'votes', 'issue_type', 'target_milestone',
'priority', 'assigned_to', 'short_desc',
]
# Conbert a leaf element into its value as a text string
# We assume it's "short enough" that there's only one substring
def Value(element):
v = element.firstChild
if v is None: return ''
return v.nodeValue
# Parse the XML issues file and produce a DOM for it
import sys
if len(sys.argv) > 1: xml = sys.argv[1]
else: xml = 'issues.xml'
from xml.dom.minidom import parse
xml = parse(xml)
# Go through the issues in the DOM, pick out the elements we want,
# and put them in our list of issues.
issues = []
for issuezilla in xml.childNodes:
# The Issuezilla element contains the issues
if issuezilla.nodeType != issuezilla.ELEMENT_NODE: continue
for issue in issuezilla.childNodes:
# The issue elements contain the info for an issue
if issue.nodeType != issue.ELEMENT_NODE: continue
# Accumulate the pieces we want to include
d = {}
for element in issue.childNodes:
if element.nodeName in PickList:
d[element.nodeName] = Value(element)
# convert 'votes' to numeric, ascending and descending
try:
v = int('0' + d['votes'])
except KeyError:
pass
else:
d['votes_desc'] = -v
d['votes'] = v
# Marshal the elements and add them to the list
issues.append([ d[ix] for ix in PickList ])
issues.sort()
# Transcribe the issues into comma-separated values.
# FIXME: parameterize the output file name
import csv
writer = csv.writer(open('editlist.csv', 'w'))
# header
writer.writerow(['ID', 'Votes', 'Type/Member', 'Milestone',
'Pri', 'Owner', 'Summary/Comments'])
for issue in issues:
row = issue[4:] # strip off sort key
#row[0] = """=hyperlink("http://scons.tigris.org/issues/show_bug.cgi?id=%s","%s")""" % (row[0],row[0])
if row[3] == '-unspecified-': row[3] = 'triage'
writer.writerow(['','','','','','',''])
writer.writerow(row)
writer.writerow(['','','consensus','','','',''])
writer.writerow(['','','','','','',''])
for member in team: writer.writerow(['','',member,'','','',''])
print "Exported %d issues to editlist.csv. Ready to upload to Google."%len(issues)
# Local Variables:
# tab-width:4
# indent-tabs-mode:nil
# End:
# vim: set expandtab tabstop=4 shiftwidth=4:
scons-doc-2.3.0/bin/xml_export-README 0000644 0001750 0001750 00000004143 12114661557 020053 0 ustar dktrkranz dktrkranz This copy of xml_export was snarfed from adocman-0.10 from SourceForge.
We're checking in a copy as a convenience for any future SCons project
administrator who may need to download exported XML data. The original,
unmodified contents of the README file for that release of adocman are
as follows:
adocman - Automation tool for SourceForge.net DocManager handling
Copyright (C) 2002 Open Source Development Network, Inc. ("OSDN")
File manifest:
Alexandria perl-based API for performing operations against the
SourceForge.net site, currently including basic Client
operations (i.e. login/logout) and DocManager operations
adocman The adocman program, providing the means to perform
DocManager operations from the command-line or scripts
(by project developers or admins listed as DocManager Editors)
xml_export The xml_export program, providing the means to automate
downloads of data from the XML data export facility
on SourceForge.net (by project administrators)
adocman.html Manual for adocman, including background information,
command-line options detail, etc.
xml_export.html Manual for xml_export, including basic info about
command-line options. See adocman.html for additional
information.
LICENSE License terms for adocman
README This file
TODO List of ongoing work in improving adocman. NOTE:
Please contact the maintainer before starting any effort
to improve this code. We have significantly modified
the structure and design of this program for the next
release; structure and command-line interface are subject
to change without notice.
A list of the prerequisites required to execute 'adocman' may be found
at in the PREREQUISITES section of the adocman manual (adocman.html).
Though not listed, a recent installation of 'perl' is also a prerequisite.
Support for this program may be obtained as per the SUPPORT AND BUGS
section of the adocman.html manual. Any questions or concerns regarding
this software should be escalated as per the SUPPORT AND BUGS section
of the provided manual.
The authoritative source of this software is:
https://sourceforge.net/projects/sitedocs
scons-doc-2.3.0/bin/scons-review.sh 0000755 0001750 0001750 00000001144 12114661557 017755 0 ustar dktrkranz dktrkranz #!/bin/sh
case "$1" in
'') exec svn diff --diff-cmd diff -x -c $* ;;
-m) svn diff --diff-cmd diff -x -c $* | alpine scons-dev ;;
*) echo "Error: unknown option '$1"; exit 1 ;;
esac
# OLD CODE FOR USE WITH AEGIS
#
#if test $# -ne 1; then
# echo "Usage: scons-review change#" >&2
# exit 1
#fi
#if test "X$AEGIS_PROJECT" = "X"; then
# echo "scons-review: AEGIS_PROJECT is not set" >&2
# exit 1
#fi
#DIR=`aegis -cd -dd $*`
#if test "X${DIR}" = "X"; then
# echo "scons-review: No Aegis directory for '$*'" >&2
# exit 1
#fi
#(cd ${DIR} && find * -name '*,D' | sort | xargs cat) | pine scons-dev
scons-doc-2.3.0/bin/ae-svn-ci 0000755 0001750 0001750 00000013353 12114661557 016507 0 ustar dktrkranz dktrkranz #
# aegis - project change supervisor
# Copyright (C) 2004 Peter Miller;
# All rights reserved.
#
# As a specific exception to the GPL, you are allowed to copy
# this source file into your own project and modify it, without
# releasing your project under the GPL, unless there is some other
# file or condition which would require it.
#
# MANIFEST: shell script to commit changes to Subversion
#
# This script is expected to be run by the integrate_pass_notify_command
# and as such the baseline has already assumed the shape asked for by
# the change.
#
# integrate_pass_notify_command =
# "$bin/ae-svn-ci $project $change http://svn.site.com/svn/trunk --username svn_user";
#
# Alternatively, you may wish to tailor this script to the individual
# needs of your project. Make it a source file, e.g. "etc/ae-svn-ci.sh"
# and then use the following:
#
# integrate_pass_notify_command =
# "$sh ${s etc/ae-svn-ci} $project $change http://svn.site.com/svn/trunk --username svn_user";
#
USAGE="Usage: $0 [-hnq] []"
PRINT="echo"
EXECUTE="eval"
while getopts "hnq" FLAG
do
case ${FLAG} in
h )
echo "${USAGE}"
exit 0
;;
n )
EXECUTE=":"
;;
q )
PRINT=":"
;;
* )
echo "$0: unknown option ${FLAG}" >&2
exit 1
;;
esac
done
shift `expr ${OPTIND} - 1`
case $# in
[012])
echo "${USAGE}" 1>&2
exit 1
;;
*)
project=$1
change=$2
svn_url=$3
shift 3
svn_co_flags=$*
;;
esac
here=`pwd`
AEGIS_PROJECT=$project
export AEGIS_PROJECT
AEGIS_CHANGE=$change
export AEGIS_CHANGE
module=`echo $project | sed 's|[.].*||'`
baseline=`aegis -cd -bl`
if test X${TMPDIR} = X; then TMPDIR=/var/tmp; fi
TMP=${TMPDIR}/ae-svn-ci.$$
mkdir ${TMP}
cd ${TMP}
PWD=`pwd`
if test X${PWD} != X${TMP}; then
echo "$0: ended up in ${PWD}, not ${TMP}" >&2
exit 1
fi
fail()
{
set +x
cd $here
rm -rf ${TMP}
echo "FAILED" 1>&2
exit 1
}
trap "fail" 1 2 3 15
Command()
{
${PRINT} "$*"
${EXECUTE} "$*"
}
#
# Create a new Subversion work area.
#
# Note: this assumes the module is checked-out into a directory of the
# same name. Is there a way to ask Subversion where it is going to put a
# module, so we can always get the "cd" right?
#
${PRINT} svn co $svn_url $module $svn_co_flags
${EXECUTE} svn co $svn_url $module $svn_co_flags > LOG 2>&1
if test $? -ne 0; then cat LOG; fail; fi
${EXECUTE} cd $module
#
# Now we need to extract the sources from Aegis and drop them into the
# Subversion work area. There are two ways to do this.
#
# The first way is to use the generated tarball.
# This has the advantage that it has the Makefile.in file in it, and
# will work immediately.
#
# The second way is to use aetar, which will give exact sources, and
# omit all derived files. This will *not* include the Makefile.in,
# and so will not be readily compilable.
#
# gunzip < $baseline/export/${project}.tar.gz | tardy -rp ${project} | tar xf -
aetar -send -comp-alg=gzip -o - | tar xzf -
#
# If any new directories have been created we will need to add them
# to Subversion before we can add the new files which we know are in them,
# or they would not have been created. Do this only if the -n option
# isn't used, because if it is, we won't have actually checked out the
# source and we'd erroneously report that all of them need to be added.
#
if test "X${EXECUTE}" != "X:"
then
find . -name .svn -prune -o -type d -print |
xargs --max-args=1 |
while read dir
do
if [ ! -d "$dir/.svn" ]
then
Command svn add -N "$dir"
fi
done
fi
#
# Use the Aegis meta-data to perform some commands that Subversion can't
# figure out for itself. We use an inline "aer" report script to identify
# when a remove-create pair are actually due to a move.
#
aegis -rpt -nph -f - <<_EOF_ |
auto cs;
cs = project[project_name()].state.branch.change[change_number()];
columns({width = 1000;});
auto file, moved;
for (file in cs.src)
{
if (file.move != "")
moved[file.move] = 1;
}
auto action;
for (file in cs.src)
{
if (file.action == "remove" && file.move != "")
action = "move";
else
action = file.action;
/*
* Suppress printing of any files created as the result of a move.
* These are printed as the destination when printing the line for
* the file that was *removed* as a result of the move.
*/
if (action != "create" || ! moved[file.file_name])
print(sprintf("%s %s \\"%s\\" \\"%s\\"", file.usage, action, file.file_name, file.move));
}
_EOF_
while read line
do
eval set -- "$line"
usage="$1"
action="$2"
srcfile="$3"
dstfile="$4"
case $action in
create)
Command svn add $srcfile
;;
remove)
Command rm -f $srcfile
Command svn remove $srcfile
;;
move)
Command mv $dstfile $dstfile.move
Command svn move $srcfile $dstfile
Command cp $dstfile.move $dstfile
Command rm -f $dstfile.move
;;
*)
;;
esac
done
#
# Extract the brief description. We'd like to do this using aesub
# or something, like so:
#
# message=`aesub '${version} - ${change description}'`
#
# but the expansion of ${change description} has a lame hard-coded max of
# 80 characters, so we have to do this by hand. (This has the slight
# benefit of preserving backslashes in front of any double-quotes in
# the text; that will have to be handled if we go back to using aesub.)
#
description=`aegis -ca -l | sed -n 's/brief_description = "\(.*\)";$/\1/p'`
version=`aesub '${version}'`
message="$version - $description"
#
# Now commit all the changes.
#
Command svn commit -m \"$message\"
#
# All done. Clean up and go home.
#
cd $here
rm -rf ${TMP}
exit 0
scons-doc-2.3.0/bin/xml_export 0000644 0001750 0001750 00000020710 12114661557 017116 0 ustar dktrkranz dktrkranz #!/usr/bin/perl -w
#
# xml_export - Retrieve data from the SF.net XML export for project data
#
# Copyright (C) 2002 Open Source Development Network, Inc. ("OSDN")
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the license details found
# below in the section marked "$LICENSE_TEXT".
#
# SCons: modified the following RCS Id line so it won't expand during
# our checkins.
#
# $_Id: adocman,v 1.51 2002/06/07 18:56:35 moorman Exp _$
#
# Written by Nate Oostendorp
# and Jacob Moorman
###########################################################################
use strict;
use Alexandria::Client;
use HTTP::Request::Common;
my $client = new Alexandria::Client;
util_verifyvariables("groupid");
my $res = $ua->simple_request(GET "$config{hosturl}/export/xml_export.php?group_id=$config{groupid}");
if (not $res->is_success()) {
die "Failed to connect: ".$res->as_string();
}
print $res->content;
###########################################################################
__END__
=head1 NAME
xml_export - Retrieve data for a project via the SF.net XML export facility
=head1 DESCRIPTION
B provides a simple mechanism to download data from the
XML data export facility on SourceForge.net. This utility is needed
(in place of a downloader like wget or curl) since authentication by
a project administrator is required to access the XML export facility.
=head1 SYNOPSIS
xml_export [options] > output_file
OPTIONS
--login Login to the SourceForge.net site
--logout Logout of the SourceForge.net site
--groupid=GROUPID Group ID of the project whose data you wish to export
=head1 ERROR LEVELS
The following error levels are returned upon exit of this program:
0 success
1 failure: general (requested DocManager operation failed)
2 failure: authentication failure
3 failure: must --login before performing this operation
4 failure: bad command-line option specified or variable setting problem
5 failure: error in accessing/creating a file or directory
6 failure: failed to enter requested input before timeout expired
=head1 AUTHORITATIVE SOURCE
The original version of B may be found in the materials
provided from the SourceForge.net Site Documentation project (sitedocs)
on the SourceForge.net site. The latest version of this program
may be found in the CVS repository for the sitedocs project on
SourceForge.net. The sitedocs project pages may be accessed at:
http://sourceforge.net/projects/sitedocs
=head1 SECURITY
For security-related information for this application, please review
the documentation provided for the adocman utility.
=head1 EXAMPLES
The following are examples for using this program to export project
data via the XML data export facility on SourceForge.net. It is presumed
that you have a valid SourceForge.net user account, which is listed as
a project administrator on the project in question. This tool will
only work for project administrators. The group ID for the project
may be derived from the URL for the Admin page for the project, or by
viewing the Project Admin page for the project (look for the text
"Your Group ID is: xxxxxx").
To login to the SourceForge.net site via the command-line:
adocman --username=myusername --password=mypassword --login \
--groupid=8675309
To login to the SourceForge.net site, and be prompted to enter your
password interactively:
adocman --username=myusername --interactive --login --groupid=8675309
To perform an export (after logging-in):
xml_export --groupid=8675309 > output.xml
To logout of SourceForge.net:
adocman --logout
Additional capabilities (including the use of configuration files to
specify information that would otherwise be provided interactively
or on the command-line) are detailed in the documentation provided for
the adocman utility.
To obtain output for debugging a problem, perform the same command
as originally tested, but first add the --verbose flag, and determine
whether you are able to solve the issue on your own. If the problem
persists, see the "SUPPORT AND BUGS" section, below.
=head1 SUPPORT AND BUGS
This program was written by a member of the SourceForge.net staff
team. This software has been released under an Open Source license,
for the greater benefit of the SourceForge.net developer community.
The SourceForge.net Site Documentation project is the caretaker of
this software. Issues related to the use of this program, or bugs
found in using this program, may be reported to the SourceForge.net
Site Documentation project using their Support Request Tracker at:
https://sourceforge.net/tracker/?func=add&group_id=52614&atid=467457
Any support that is provided for this program is provided as to
further enhance the stability and functionality of this program
for SourceForge.net users. The SourceForge.net Site Documentation
project makes use of this software for its own internal purposes,
in managing the Site Documentation collection for the SourceForge.net
site.
=head1 AUTHOR
Nathan Oostendorp and
Jacob Moorman
=head1 PREREQUISITES
C, C, C, C,
C
These prerequisites may be installed in an interactive, but automated
fashion through the use of perl's CPAN module, invoked as:
perl -MCPAN -e shell;
=head1 LICENSE
Copyright (c) 2002 Open Source Development Network, Inc. ("OSDN")
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
1. The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
2. Neither the names of VA Software Corporation, OSDN, SourceForge.net,
the SourceForge.net Site Documentation project, nor the names of its
contributors may be used to endorse or promote products derived from
the Software without specific prior written permission of OSDN.
3. The name and trademarks of copyright holders may NOT be used in
advertising or publicity pertaining to the Software without specific,
written prior permission. Title to copyright in the Software and
any associated documentation will at all times remain with copyright
holders.
4. If any files are modified, you must cause the modified files to carry
prominent notices stating that you changed the files and the date of
any change. We recommend that you provide URLs to the location from which
the code is derived.
5. Altered versions of the Software must be plainly marked as such, and
must not be misrepresented as being the original Software.
6. The origin of the Software must not be misrepresented; you must not
claim that you wrote the original Software. If you use the Software in a
product, an acknowledgment in the product documentation would be
appreciated but is not required.
7. The data files supplied as input to, or produced as output from,
the programs of the Software do not automatically fall under the
copyright of the Software, but belong to whomever generated them, and may
be sold commercially, and may be aggregated with the Software.
8. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE OR DOCUMENTATION.
This Software consists of contributions made by OSDN and many individuals
on behalf of OSDN. Specific attributions are listed in the accompanying
credits file.
=head1 HISTORY
B<2002-12-03> Completed version 0.10 - move to classes, added POD
=cut
scons-doc-2.3.0/bin/upload-release-files.sh 0000755 0001750 0001750 00000003576 12114661557 021346 0 ustar dktrkranz dktrkranz #!/bin/sh
if [ $# -lt 2 ]; then
echo Usage: $0 VERSION SF_USERNAME
exit 1
fi
VERSION=$1; shift
SF_USER=$1; shift
RSYNC='rsync'
RSYNCOPTS='-v -e ssh'
SF_MACHINE='frs.sourceforge.net'
SF_TOPDIR='/home/frs/project/scons'
# the build products are here:
cd build/dist
cp -f ../../src/CHANGES.txt ../../src/RELEASE.txt ../../src/Announce.txt .
set -x
# Upload main scons release files:
$RSYNC $RSYNCOPTS \
scons-$VERSION-1.noarch.rpm \
scons-$VERSION-1.src.rpm \
scons-$VERSION-setup.exe \
scons-$VERSION.tar.gz \
scons-$VERSION.zip \
Announce.txt CHANGES.txt RELEASE.txt \
$SF_USER@$SF_MACHINE:$SF_TOPDIR/scons/$VERSION/
# Local packages:
$RSYNC $RSYNCOPTS \
scons-local-$VERSION.tar.gz \
scons-local-$VERSION.zip \
Announce.txt CHANGES.txt RELEASE.txt \
$SF_USER@$SF_MACHINE:$SF_TOPDIR/scons-local/$VERSION/
# Source packages:
$RSYNC $RSYNCOPTS \
scons-src-$VERSION.tar.gz \
scons-src-$VERSION.zip \
Announce.txt CHANGES.txt RELEASE.txt \
$SF_USER@$SF_MACHINE:$SF_TOPDIR/scons-src/$VERSION/
#
# scons.org stuff:
#
# Doc: copy the doc tgz over; we'll unpack later
$RSYNC $RSYNCOPTS \
scons-doc-$VERSION.tar.gz \
scons@scons.org:public_html/production/doc/$VERSION/
# Copy the changelog
$RSYNC $RSYNCOPTS \
CHANGES.txt \
scons@scons.org:public_html/production/
# Note that Announce.txt gets copied over to RELEASE.txt.
# This should be fixed at some point.
$RSYNC $RSYNCOPTS \
Announce.txt \
scons@scons.org:public_html/production/RELEASE.txt
# Unpack the doc and repoint doc symlinks:
ssh scons@scons.org "
cd public_html/production/doc
cd $VERSION
tar xvf scons-doc-$VERSION.tar.gz
cd ..
rm latest; ln -s $VERSION latest
rm production; ln -s $VERSION production
for f in HTML PDF PS TEXT; do rm $f; ln -s $VERSION/$f $f; done
"
echo '*****'
echo '***** Now manually update index.php, includes/versions.php and news-raw.xhtml on scons.org.'
echo '*****'
scons-doc-2.3.0/bin/install_scons.py 0000644 0001750 0001750 00000016332 12114661557 020224 0 ustar dktrkranz dktrkranz #!/usr/bin/env python
#
# A script for unpacking and installing different historic versions of
# SCons in a consistent manner for side-by-side development testing.
#
# This abstracts the changes we've made to the SCons setup.py scripts in
# different versions so that, no matter what version is specified, it ends
# up installing the necessary script(s) and library into version-specific
# names that won't interfere with other things.
#
# By default, we expect to extract the .tar.gz files from a Downloads
# subdirectory in the current directory.
#
# Note that this script cleans up after itself, removing the extracted
# directory in which we do the build.
#
# This was written for a Linux system (specifically Ubuntu) but should
# be reasonably generic to any POSIX-style system with a /usr/local
# hierarchy.
import getopt
import os
import shutil
import sys
import tarfile
import urllib
from Command import CommandRunner, Usage
all_versions = [
'0.01',
'0.02',
'0.03',
'0.04',
'0.05',
'0.06',
'0.07',
'0.08',
'0.09',
'0.10',
'0.11',
'0.12',
'0.13',
'0.14',
'0.90',
'0.91',
'0.92',
'0.93',
'0.94',
#'0.94.1',
'0.95',
#'0.95.1',
'0.96',
'0.96.1',
'0.96.90',
'0.96.91',
'0.96.92',
'0.96.93',
'0.96.94',
'0.96.95',
'0.96.96',
'0.97',
'0.97.0d20070809',
'0.97.0d20070918',
'0.97.0d20071212',
'0.98.0',
'0.98.1',
'0.98.2',
'0.98.3',
'0.98.4',
'0.98.5',
'1.0.0',
'1.0.0.d20080826',
'1.0.1',
'1.0.1.d20080915',
'1.0.1.d20081001',
'1.1.0',
'1.1.0.d20081104',
'1.1.0.d20081125',
'1.1.0.d20081207',
'1.2.0',
'1.2.0.d20090113',
'1.2.0.d20090223',
'1.2.0.d20090905',
'1.2.0.d20090919',
'1.2.0.d20091224',
'1.2.0.d20100117',
'1.2.0.d20100306',
'1.3.0',
'1.3.0.d20100404',
'1.3.0.d20100501',
'1.3.0.d20100523',
'1.3.0.d20100606',
'2.0.0.alpha.20100508',
'2.0.0.beta.20100531',
'2.0.0.beta.20100605',
'2.0.0.final.0',
]
def main(argv=None):
if argv is None:
argv = sys.argv
all = False
downloads_dir = 'Downloads'
downloads_url = 'http://downloads.sourceforge.net/scons'
if sys.platform == 'win32':
sudo = ''
prefix = sys.prefix
else:
sudo = 'sudo'
prefix = '/usr/local'
python = sys.executable
short_options = 'ad:hnp:q'
long_options = ['all', 'help', 'no-exec', 'prefix=', 'quiet']
helpstr = """\
Usage: install_scons.py [-ahnq] [-d DIR] [-p PREFIX] [VERSION ...]
-a, --all Install all SCons versions.
-d DIR, --downloads=DIR Downloads directory.
-h, --help Print this help and exit
-n, --no-exec No execute, just print command lines
-p PREFIX, --prefix=PREFIX Installation prefix.
-q, --quiet Quiet, don't print command lines
"""
try:
try:
opts, args = getopt.getopt(argv[1:], short_options, long_options)
except getopt.error, msg:
raise Usage(msg)
for o, a in opts:
if o in ('-a', '--all'):
all = True
elif o in ('-d', '--downloads'):
downloads_dir = a
elif o in ('-h', '--help'):
print helpstr
sys.exit(0)
elif o in ('-n', '--no-exec'):
CommandRunner.execute = CommandRunner.do_not_execute
elif o in ('-p', '--prefix'):
prefix = a
elif o in ('-q', '--quiet'):
CommandRunner.display = CommandRunner.do_not_display
except Usage, err:
sys.stderr.write(str(err.msg) + '\n')
sys.stderr.write('use -h to get help\n')
return 2
if all:
if args:
msg = 'install-scons.py: -a and version arguments both specified'
sys.stderr.write(msg)
sys.exit(1)
args = all_versions
cmd = CommandRunner()
for version in args:
scons = 'scons-' + version
tar_gz = os.path.join(downloads_dir, scons + '.tar.gz')
tar_gz_url = "%s/%s.tar.gz" % (downloads_url, scons)
cmd.subst_dictionary(locals())
if not os.path.exists(tar_gz):
if not os.path.exists(downloads_dir):
cmd.run('mkdir %(downloads_dir)s')
cmd.run((urllib.urlretrieve, tar_gz_url, tar_gz),
'wget -O %(tar_gz)s %(tar_gz_url)s')
def extract(tar_gz):
tarfile.open(tar_gz, "r:gz").extractall()
cmd.run((extract, tar_gz), 'tar zxf %(tar_gz)s')
cmd.run('cd %(scons)s')
if version in ('0.01', '0.02', '0.03', '0.04', '0.05',
'0.06', '0.07', '0.08', '0.09', '0.10'):
# 0.01 through 0.10 install /usr/local/bin/scons and
# /usr/local/lib/scons. The "scons" script knows how to
# look up the library in a version-specific directory, but
# we have to move both it and the library directory into
# the right version-specific name by hand.
cmd.run('%(python)s setup.py build')
cmd.run('%(sudo)s %(python)s setup.py install --prefix=%(prefix)s')
cmd.run('%(sudo)s mv %(prefix)s/bin/scons %(prefix)s/bin/scons-%(version)s')
cmd.run('%(sudo)s mv %(prefix)s/lib/scons %(prefix)s/lib/scons-%(version)s')
elif version in ('0.11', '0.12', '0.13', '0.14', '0.90'):
# 0.11 through 0.90 install /usr/local/bin/scons and
# /usr/local/lib/scons-%(version)s. We just need to move
# the script to a version-specific name.
cmd.run('%(python)s setup.py build')
cmd.run('%(sudo)s %(python)s setup.py install --prefix=%(prefix)s')
cmd.run('%(sudo)s mv %(prefix)s/bin/scons %(prefix)s/bin/scons-%(version)s')
elif version in ('0.91', '0.92', '0.93',
'0.94', '0.94.1',
'0.95', '0.95.1',
'0.96', '0.96.1', '0.96.90'):
# 0.91 through 0.96.90 install /usr/local/bin/scons,
# /usr/local/bin/sconsign and /usr/local/lib/scons-%(version)s.
# We need to move both scripts to version-specific names.
cmd.run('%(python)s setup.py build')
cmd.run('%(sudo)s %(python)s setup.py install --prefix=%(prefix)s')
cmd.run('%(sudo)s mv %(prefix)s/bin/scons %(prefix)s/bin/scons-%(version)s')
cmd.run('%(sudo)s mv %(prefix)s/bin/sconsign %(prefix)s/bin/sconsign-%(version)s')
lib_scons = os.path.join(prefix, 'lib', 'scons')
if os.path.isdir(lib_scons):
cmd.run('%(sudo)s mv %(prefix)s/lib/scons %(prefix)s/lib/scons-%(version)s')
else:
# Versions from 0.96.91 and later support what we want
# with a --no-scons-script option.
cmd.run('%(python)s setup.py build')
cmd.run('%(sudo)s %(python)s setup.py install --prefix=%(prefix)s --no-scons-script')
cmd.run('cd ..')
cmd.run((shutil.rmtree, scons), 'rm -rf %(scons)s')
if __name__ == "__main__":
sys.exit(main())
# Local Variables:
# tab-width:4
# indent-tabs-mode:nil
# End:
# vim: set expandtab tabstop=4 shiftwidth=4:
scons-doc-2.3.0/bin/timebuild 0000644 0001750 0001750 00000003160 12114661557 016673 0 ustar dktrkranz dktrkranz #!/bin/sh
#
# Profile running SCons to build itself from the current package.
#
# This runs "aegis -build" to build a current scons-src-*.tar.gz
# package, unpacks it in the supplied directory name, and then
# starts a profiled run of an SCons build, followed by another.
# This results in two profiles:
#
# NAME/NAME-0.prof
# profile of a build-everything run
#
# NAME/NAME-1.prof
# profile of an all-up-to-date run
#
# This also copies the build scons-src-*.tar.gz file to the NAME
# subdirectory, and tars up everything under src/ as NAME/src.tar.gz,
# so that repeated runs with different in-progress changes can serve
# as their own crude version control, so you don't lose that exact
# combination of features which performed best.
if test X$1 = X; then
echo "Must supply name!" >&2
exit 1
fi
VERSION=0.90
DIR=$1
SRC="scons-src-$VERSION"
SRC_TAR_GZ="${SRC}.tar.gz"
B_D_SRC_TAR_GZ="build/dist/${SRC_TAR_GZ}"
echo "Building ${B_D_SRC_TAR_GZ}: " `date`
aegis -build ${B_D_SRC_TAR_GZ}
echo "mkdir ${DIR}: " `date`
mkdir ${DIR}
echo "cp ${B_D_SRC_TAR_GZ} ${DIR}: " `date`
cp ${B_D_SRC_TAR_GZ} ${DIR}
echo "tar cf ${DIR}/src.tar.gz: " `date`
tar cf ${DIR}/src.tar.gz src
cd ${DIR}
echo "tar zxf ${SRC_TAR_GZ}: " `date`
tar zxf ${SRC_TAR_GZ}
cd ${SRC}
SCRIPT="src/script/scons.py"
ARGS="version=$VERSION"
export SCONS_LIB_DIR=`pwd`/src/engine
echo "Build run starting: " `date`
python $SCRIPT --profile=../$DIR-0.prof $ARGS > ../$DIR-0.log 2>&1
echo "Up-to-date run starting: " `date`
python $SCRIPT --profile=../$DIR-1.prof $ARGS > ../$DIR-1.log 2>&1
echo "Finished $DIR at: " `date`
scons-doc-2.3.0/bin/svn-bisect.py 0000755 0001750 0001750 00000004142 12114661557 017425 0 ustar dktrkranz dktrkranz #!/usr/bin/env python
# -*- Python -*-
from __future__ import division
import sys
from math import log, ceil
from optparse import OptionParser
import subprocess
# crack the command line
parser = OptionParser(
usage="%prog lower-revision upper-revision test_script [arg1 ...]",
description="Binary search for a bug in a SVN checkout")
(options,script_args) = parser.parse_args()
# make sure we have sufficient parameters
if len(script_args) < 1:
parser.error("Need a lower revision")
elif len(script_args) < 2:
parser.error("Need an upper revision")
elif len(script_args) < 3:
parser.error("Need a script to run")
# extract our starting values
lower = int(script_args[0])
upper = int(script_args[1])
script = script_args[2:]
# print an error message and quit
def error(s):
print >>sys.stderr, "******", s, "******"
sys.exit(1)
# update to the specified version and run test
def testfail(revision):
"Return true if test fails"
print "Updating to revision", revision
if subprocess.call(["svn","up","-qr",str(revision)]) != 0:
m = "SVN did not update properly to revision %d"
raise RuntimeError(m % revision)
return subprocess.call(script,shell=False) != 0
# confirm that the endpoints are different
print "****** Checking upper bracket", upper
upperfails = testfail(upper)
print "****** Checking lower bracket", lower
lowerfails = testfail(lower)
if upperfails == lowerfails:
error("Upper and lower revisions must bracket the failure")
# binary search for transition
msg = "****** max %d revisions to test (bug bracketed by [%d,%d])"
while upper-lower > 1:
print msg % (ceil(log(upper-lower,2)), lower, upper)
mid = (lower + upper)//2
midfails = testfail(mid)
if midfails == lowerfails:
lower = mid
lowerfails = midfails
else:
upper = mid
upperfails = midfails
# show which revision was first to fail
if upperfails != lowerfails: lower = upper
print "The error was caused by revision", lower
# Local Variables:
# tab-width:4
# indent-tabs-mode:nil
# End:
# vim: set expandtab tabstop=4 shiftwidth=4:
scons-doc-2.3.0/bin/Command.py 0000644 0001750 0001750 00000007461 12114661557 016732 0 ustar dktrkranz dktrkranz #!/usr/bin/env python
#
# XXX Python script template
#
# XXX Describe what the script does here.
#
import getopt
import os
import shlex
import sys
class Usage(Exception):
def __init__(self, msg):
self.msg = msg
class CommandRunner(object):
"""
Representation of a command to be executed.
"""
def __init__(self, dictionary={}):
self.subst_dictionary(dictionary)
def subst_dictionary(self, dictionary):
self._subst_dictionary = dictionary
def subst(self, string, dictionary=None):
"""
Substitutes (via the format operator) the values in the specified
dictionary into the specified command.
The command can be an (action, string) tuple. In all cases, we
perform substitution on strings and don't worry if something isn't
a string. (It's probably a Python function to be executed.)
"""
if dictionary is None:
dictionary = self._subst_dictionary
if dictionary:
try:
string = string % dictionary
except TypeError:
pass
return string
def do_display(self, string):
if isinstance(string, tuple):
func = string[0]
args = string[1:]
s = '%s(%s)' % (func.__name__, ', '.join(map(repr, args)))
else:
s = self.subst(string)
if not s.endswith('\n'):
s += '\n'
sys.stdout.write(s)
sys.stdout.flush()
def do_not_display(self, string):
pass
def do_execute(self, command):
if isinstance(command, str):
command = self.subst(command)
cmdargs = shlex.split(command)
if cmdargs[0] == 'cd':
command = (os.chdir,) + tuple(cmdargs[1:])
elif cmdargs[0] == 'mkdir':
command = (os.mkdir,) + tuple(cmdargs[1:])
if isinstance(command, tuple):
func = command[0]
args = command[1:]
return func(*args)
else:
return os.system(command)
def do_not_execute(self, command):
pass
display = do_display
execute = do_execute
def run(self, command, display=None):
"""
Runs this command, displaying it first.
The actual display() and execute() methods we call may be
overridden if we're printing but not executing, or vice versa.
"""
if display is None:
display = command
self.display(display)
return self.execute(command)
def main(argv=None):
if argv is None:
argv = sys.argv
short_options = 'hnq'
long_options = ['help', 'no-exec', 'quiet']
helpstr = """\
Usage: script-template.py [-hnq]
-h, --help Print this help and exit
-n, --no-exec No execute, just print command lines
-q, --quiet Quiet, don't print command lines
"""
try:
try:
opts, args = getopt.getopt(argv[1:], short_options, long_options)
except getopt.error, msg:
raise Usage(msg)
for o, a in opts:
if o in ('-h', '--help'):
print helpstr
sys.exit(0)
elif o in ('-n', '--no-exec'):
Command.execute = Command.do_not_execute
elif o in ('-q', '--quiet'):
Command.display = Command.do_not_display
except Usage, err:
sys.stderr.write(err.msg)
sys.stderr.write('use -h to get help')
return 2
commands = [
]
for command in [ Command(c) for c in commands ]:
status = command.run(command)
if status:
sys.exit(status)
if __name__ == "__main__":
sys.exit(main())
# Local Variables:
# tab-width:4
# indent-tabs-mode:nil
# End:
# vim: set expandtab tabstop=4 shiftwidth=4:
scons-doc-2.3.0/bin/objcounts.py 0000644 0001750 0001750 00000005720 12114661557 017356 0 ustar dktrkranz dktrkranz #!/usr/bin/env python
#
# Copyright (c) 2005 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
import re
import sys
filenames = sys.argv[1:]
if len(sys.argv) != 3:
print """Usage: objcounts.py file1 file2
Compare the --debug=object counts from two build logs.
"""
sys.exit(0)
def fetch_counts(fname):
contents = open(fname).read()
m = re.search('\nObject counts:(\n\s[^\n]*)*', contents, re.S)
lines = m.group().split('\n')
list = [l.split() for l in lines if re.match('\s+\d', l)]
d = {}
for l in list:
d[l[-1]] = list(map(int, l[:-1]))
return d
c1 = fetch_counts(sys.argv[1])
c2 = fetch_counts(sys.argv[2])
common = {}
for k in c1.keys():
try:
common[k] = (c1[k], c2[k])
except KeyError:
# Transition: we added the module to the names of a bunch of
# the logged objects. Assume that c1 might be from an older log
# without the modules in the names, and look for an equivalent
# in c2.
if not '.' in k:
s = '.'+k
l = len(s)
for k2 in c2.keys():
if k2[-l:] == s:
common[k2] = (c1[k], c2[k2])
del c1[k]
del c2[k2]
break
else:
del c1[k]
del c2[k]
def diffstr(c1, c2):
try:
d = c2 - c1
except TypeError:
d = ''
else:
if d:
d = '[%+d]' % d
else:
d = ''
return " %5s/%-5s %-8s" % (c1, c2, d)
def printline(c1, c2, classname):
print \
diffstr(c1[2], c2[2]) + \
diffstr(c1[3], c2[3]) + \
' ' + classname
for k in sorted(common.keys()):
c = common[k]
printline(c[0], c[1], k)
for k in sorted(list(c1.keys())):
printline(c1[k], ['--']*4, k)
for k in sorted(list(c2.keys())):
printline(['--']*4, c2[k], k)
# Local Variables:
# tab-width:4
# indent-tabs-mode:nil
# End:
# vim: set expandtab tabstop=4 shiftwidth=4:
scons-doc-2.3.0/bin/memlogs.py 0000644 0001750 0001750 00000003263 12114661557 017013 0 ustar dktrkranz dktrkranz #!/usr/bin/env python
#
# Copyright (c) 2005 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
import getopt
import sys
filenames = sys.argv[1:]
if not filenames:
print """Usage: memlogs.py file [...]
Summarizes the --debug=memory numbers from one or more build logs.
"""
sys.exit(0)
fmt = "%12s %12s %12s %12s %s"
print fmt % ("pre-read", "post-read", "pre-build", "post-build", "")
for fname in sys.argv[1:]:
lines = [l for l in open(fname).readlines() if l[:7] == 'Memory ']
t = tuple([l.split()[-1] for l in lines]) + (fname,)
print fmt % t
# Local Variables:
# tab-width:4
# indent-tabs-mode:nil
# End:
# vim: set expandtab tabstop=4 shiftwidth=4:
scons-doc-2.3.0/bin/restore.sh 0000644 0001750 0001750 00000004342 12114661557 017014 0 ustar dktrkranz dktrkranz #!/usr/bin/env sh
#
# Simple hack script to restore __revision__, __COPYRIGHT_, 2.3.0
# and other similar variables to what gets checked in to source. This
# comes in handy when people send in diffs based on the released source.
#
if test "X$*" = "X"; then
DIRS="src test"
else
DIRS="$*"
fi
SEPARATOR="================================================================================"
header() {
arg_space="$1 "
dots=`echo "$arg_space" | sed 's/./\./g'`
echo "$SEPARATOR" | sed "s;$dots;$arg_space;"
}
for i in `find $DIRS -name '*.py'`; do
header $i
ed $i <