diff options
author | Daniel Burrows <dburrows@debian.org> | 2010-04-26 07:03:12 -0700 |
---|---|---|
committer | Daniel Burrows <dburrows@debian.org> | 2010-04-26 07:03:12 -0700 |
commit | d9f78ae328066d79fc5bd99b928a3c77d767f787 (patch) | |
tree | bef8ccddab1a3960fe4f372ecb260337c88ed01c /site_scons | |
parent | bd44618d07293fe86cbd3fc2934f591e75d18bc2 (diff) | |
download | aptitude-d9f78ae328066d79fc5bd99b928a3c77d767f787.tar.gz |
Don't require fixman to be provided by a function, and get it working.
Diffstat (limited to 'site_scons')
-rw-r--r-- | site_scons/site_tools/aptitude_doc.py | 39 |
1 files changed, 27 insertions, 12 deletions
diff --git a/site_scons/site_tools/aptitude_doc.py b/site_scons/site_tools/aptitude_doc.py index e1f1df48..bbf9c5d0 100644 --- a/site_scons/site_tools/aptitude_doc.py +++ b/site_scons/site_tools/aptitude_doc.py @@ -60,11 +60,10 @@ README.$LANG). output_man is the output manpage (defaults to aptitude.$LANG.8). -manpage_postprocess is a function that takes the working directory and -returns a command to invoke after the manpage is fully built. It is -provided as part of porting the legacy documentation build system; -some of the languages want to run a postprocessing script on the -manpage. +manpage_postprocess gives a script that should be run after building +the documentation. It\'s provided as part of porting the legacy +documentation build system; some of the languages want to run a +postprocessing script on the manpage. temp_txt is the temporary directory used to build the text documentation. @@ -74,7 +73,7 @@ temp_man is the temporary directory used to build the manpage. mainfile is the main XML file (defaults to aptitude.xml), or None if not present. -manpage is the manpage's XML file (defaults to manpage.xml), or None +manpage is the manpage\'s XML file (defaults to manpage.xml), or None if not present. If mainfile is None, this is assumed to be a standalone XML file. @@ -82,7 +81,7 @@ images is the directory containing images to go with the HTML documentation, or None if not present. Set dist_xmls to False to keep the XML files from automatically being -included in the source archive (e.g., because they're autogenerated). +included in the source archive (e.g., because they\'re autogenerated). The input XML files and the images directory are implicitly added to @@ -108,10 +107,23 @@ build the HTML, text, and manpage documentation respectively.''' env.Dist(manpage) # Images are registered later on an individual basis. - outputs = [] - fixman = [] + + # Set up the "fixman" script if there is one. We need to add the + # script as a "source" of the manpage, and we need to invoke it as + # "./fixman". + fixman_dep = [] + fixman_action = [] if manpage_postprocess is not None: - fixman.append(manpage_postprocess(Dir('.').path)) + # "." isn't in the path by default; put it into the + # postprocess invocation. + def relative(path): + if os.path.isabs(path): + return path + else: + return os.path.join('.', path) + fixman_action.append(env.Action(relative(manpage_postprocess), + chdir = Dir('.').path)) + fixman_dep.append(File(manpage_postprocess)) # Make sure that the input XML files are File/Dir nodes. if isinstance(manpage, basestring): @@ -127,6 +139,8 @@ build the HTML, text, and manpage documentation respectively.''' aptitude_man_xsl = File('../aptitude-man.xsl') aptitude_txt_xsl = File('../aptitude-txt.xsl') + outputs = [] + # Generate HTML and text documentation, if it exists. if mainfile is not None: # Note: automatically assume this depends on the manpage. It @@ -186,8 +200,9 @@ build the HTML, text, and manpage documentation respectively.''' # out their dependencies. env.Depends(manpage_out, manpage) - man = env.Command(output_man, manpage_out, - [Copy('$TARGET', '$SOURCE')] + fixman) + man_action = [Copy('$TARGET', '$SOURCE')] + fixman_action + man = env.Command(output_man, [manpage_out, fixman_dep], + man_action) env.Install('$MANDIR/%s/man8' % lang, man) env.Alias('doc-man', man) outputs.append(man) |