From 7633be5b72a7070f8bb014324be653c1156a854c Mon Sep 17 00:00:00 2001 From: Dirk Baechle Date: Sun, 18 Jan 2015 01:43:36 +0100 Subject: - providing MAN page stubs when not all doc packages for the packaging process are installed - fixed refmiscinfo for MAN pages --- doc/SConscript | 41 ++++++++++++++++++++++++++++++++++++++--- doc/man/scons-time.xml | 3 ++- doc/man/scons.xml | 3 ++- doc/man/sconsign.xml | 3 ++- 4 files changed, 44 insertions(+), 6 deletions(-) diff --git a/doc/SConscript b/doc/SConscript index 6b87f6f..35eb380 100644 --- a/doc/SConscript +++ b/doc/SConscript @@ -95,11 +95,49 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT. """ % (date, ver, rev)) + +# The names of the target files for the MAN pages +man_page_list = ['scons.1','scons-time.1','sconsign.1'] + +# Template for the MAN page texts when we can't properly +# create them because the skip_doc flag is set (required +# modules/tools aren't installed in the current system) +man_replace_tpl = """.TH "%(uctitle)s" "1" "%(today)s" "SCons %(version)s" "SCons %(version)s" +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.nh +.ad l +.SH "NOTE" +%(title)s \- This is a replacement file, stemming from an incomplete +packaging process without the required doc modules installed. Please +update the system and try running bootstrap.py again. +""" + # # --- Processing --- # if skip_doc: print "doc: ...skipping building User Guide." + print " ...creating fake MAN pages." + + # Since the top-level SConstruct requires the MAN + # pages to exist for the basic packaging, we create simple + # stub texts here as replacement... + scdir = os.path.join(build, 'man') + if not os.path.isdir(scdir): + os.makedirs(scdir) + + import datetime + today = datetime.date.today().strftime("%m/%d/%Y") + version = env.subst('$VERSION') + for m in man_page_list: + man, _ = os.path.splitext(m) + fman = open(os.path.join(scdir, m), "w") + fman.write(man_replace_tpl % {'uctitle' : man.upper().replace("-", "\\-"), + 'today' : today, + 'title' : man, + 'version' : version}) + fman.close() else: if not lynx: print "doc: Warning, lynx is not installed...created release packages won't be complete!" @@ -278,9 +316,6 @@ else: 'man' : (['man','epub','text'], [], []) } - # The names of the target files for the MAN pages - man_page_list = ['scons.1','scons-time.1','sconsign.1'] - # # We have to tell SCons to scan the top-level XML files which # get included by the document XML files in the subdirectories. diff --git a/doc/man/scons-time.xml b/doc/man/scons-time.xml index a1ecadf..e0fa6b1 100644 --- a/doc/man/scons-time.xml +++ b/doc/man/scons-time.xml @@ -32,7 +32,8 @@ SCONS-TIME 1 -__MONTH_YEAR__ +SCons __VERSION__ +SCons __VERSION__ scons-time diff --git a/doc/man/scons.xml b/doc/man/scons.xml index 55f2d63..08a942b 100644 --- a/doc/man/scons.xml +++ b/doc/man/scons.xml @@ -75,7 +75,8 @@ SCONS 1 -__MONTH_YEAR__ +SCons __VERSION__ +SCons __VERSION__ scons diff --git a/doc/man/sconsign.xml b/doc/man/sconsign.xml index ca99db6..44a1e5f 100644 --- a/doc/man/sconsign.xml +++ b/doc/man/sconsign.xml @@ -32,7 +32,8 @@ SCONSIGN 1 -__MONTH_YEAR__ +SCons __VERSION__ +SCons __VERSION__ sconsign -- cgit v0.12