diff options
author | Steven Knight <knight@baldmt.com> | 2002-04-04 09:07:00 (GMT) |
---|---|---|
committer | Steven Knight <knight@baldmt.com> | 2002-04-04 09:07:00 (GMT) |
commit | 6603cc0d6643e529da45fef6f85fcc1a0fc02ea4 (patch) | |
tree | 4a27de7c3fd70e5af0f257ccc73aab38e343f156 /doc | |
parent | a7669bc6a02999a3375c7e732a27ded5f9bb9935 (diff) | |
download | SCons-6603cc0d6643e529da45fef6f85fcc1a0fc02ea4.zip SCons-6603cc0d6643e529da45fef6f85fcc1a0fc02ea4.tar.gz SCons-6603cc0d6643e529da45fef6f85fcc1a0fc02ea4.tar.bz2 |
Fix --debug=tree for directory targets (Anthony Roach)
Diffstat (limited to 'doc')
-rw-r--r-- | doc/SConscript | 40 | ||||
-rw-r--r-- | doc/man/scons.1 | 15 |
2 files changed, 27 insertions, 28 deletions
diff --git a/doc/SConscript b/doc/SConscript index f0cc97f..898f370 100644 --- a/doc/SConscript +++ b/doc/SConscript @@ -71,7 +71,7 @@ format_re = re.compile(r'<(?:graphic|imagedata)\s+fileref="([^"]*)"(?:\s+format= # defined as a SYSTEM entity is, in fact, a file included # somewhere in the document. # -def scansgml(node, env, argument = None): +def scansgml(node, env, target): includes = [] contents = node.get_contents() @@ -83,12 +83,22 @@ def scansgml(node, env, argument = None): file, format = m if format and file[-len(format):] != format: file = file + format - if argument and not os.path.isabs(file): - file = os.path.join(argument, file) + if not os.path.isabs(file): + a = [] + f = file + while 1: + f, tail = os.path.split(f) + if tail == 'doc': + break + a = [tail] + a + file = apply(os.path.join, a, {}) includes.append(file) return includes +s = Scanner(name = 'sgml', function = scansgml, skeys = ['.sgml', '.mod']) +env = env.Copy(SCANNERS = [s]) + if jw: # # Always create a version.sgml file containing the version information @@ -119,9 +129,6 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT. 'ps' : 1, 'pdf' : 1, 'text' : 0, - 'scan' : Scanner(name = 'design', - function = scansgml, - argument = 'design'), }, 'python10' : { 'htmlindex' : 't1.html', @@ -130,19 +137,13 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT. 'pdf' : 0, 'text' : 0, 'graphics' : [ 'arch', 'builder', 'job-task', 'node', 'scanner', 'sig' ], - 'scan' : Scanner(name = 'python10', - function = scansgml, - argument = 'python10'), }, 'user' : { 'htmlindex' : 'book1.html', - 'html' : 0, - 'ps' : 0, - 'pdf' : 0, + 'html' : 1, + 'ps' : 1, + 'pdf' : 1, 'text' : 0, - 'scan' : Scanner(name = 'user', - function = scansgml, - argument = 'user'), }, } @@ -155,11 +156,6 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT. 'copyright.sgml', ] - s = Scanner(name = 'sgml', function = scansgml) - - for sgml in included_sgml: - File(sgml).scanner_set(s) - # # For each document, build the document itself in HTML, Postscript, # and PDF formats. @@ -175,10 +171,6 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT. pdf = os.path.join('PDF', 'scons-%s.pdf' % doc) text = os.path.join('TEXT', 'scons-%s.txt' % doc) - s = docs[doc].get('scan') - if s: - File(main).scanner_set(s) - if docs[doc].get('html') and jade: cmds = [ "rm -f ${TARGET.dir}/*.html", diff --git a/doc/man/scons.1 b/doc/man/scons.1 index 93086f6..77dedc5 100644 --- a/doc/man/scons.1 +++ b/doc/man/scons.1 @@ -1665,9 +1665,11 @@ the Node (file) and return a list of strings (file names) representing the implicit dependencies found in the contents. -The function takes three arguments: +The function takes three or four arguments: - def scanner_function(node, env, arg): + def scanner_function(node, env, target): + + def scanner_function(node, env, target, arg): The .B node @@ -1687,9 +1689,14 @@ Fetch values from it using the method. The +.B target +argument is the internal +SCons node representing the target file. + +The .B arg argument is the argument supplied -when the scanner was created. +when the scanner was created, if any. .SH EXAMPLES @@ -1780,7 +1787,7 @@ import re include_re = re.compile(r'^include\\s+(\\S+)$', re.M) -def kfile_scan(node, env, arg): +def kfile_scan(node, env, target, arg): contents = node.get_contents() includes = include_re.findall(contents) return includes |