[65912] branches/new-help-system/base/doc

raimue at macports.org raimue at macports.org
Fri Apr 2 16:42:46 PDT 2010


Revision: 65912
          http://trac.macports.org/changeset/65912
Author:   raimue at macports.org
Date:     2010-04-02 16:42:45 -0700 (Fri, 02 Apr 2010)
Log Message:
-----------
Track include:: dependencies in Makefile

Modified Paths:
--------------
    branches/new-help-system/base/doc/Makefile

Added Paths:
-----------
    branches/new-help-system/base/doc/asciidoc-deps.tcl

Property Changed:
----------------
    branches/new-help-system/base/doc/


Property changes on: branches/new-help-system/base/doc
___________________________________________________________________
Modified: svn:ignore
   - macports.conf
prefix.mtree
macosx.mtree
asciidoc.conf
*[0-9].gz
*[0-9].xml
*[0-9].html

   + macports.conf
prefix.mtree
macosx.mtree
asciidoc.conf
*[0-9].gz
*[0-9].xml
*[0-9].html
.dep


Modified: branches/new-help-system/base/doc/Makefile
===================================================================
--- branches/new-help-system/base/doc/Makefile	2010-04-02 23:41:08 UTC (rev 65911)
+++ branches/new-help-system/base/doc/Makefile	2010-04-02 23:42:45 UTC (rev 65912)
@@ -21,6 +21,12 @@
 
 all: man
 
+# Update "include::" dependencies
+.dep: $(wildcard *.txt) asciidoc-deps.tcl
+	$(TCLSH) ./asciidoc-deps.tcl *.txt > $@
+
+-include .dep
+
 man: ${MAN} ${MAN:%=%.gz}
 
 xml: ${MAN:%=%.xml}
@@ -32,6 +38,7 @@
 	rm -f *.{1,5,7}.html
 	rm -f *.{1,5,7}.xml
 	rm -f *.{1,5,7}.gz
+	rm -f .dep
 
 test:
 

Added: branches/new-help-system/base/doc/asciidoc-deps.tcl
===================================================================
--- branches/new-help-system/base/doc/asciidoc-deps.tcl	                        (rev 0)
+++ branches/new-help-system/base/doc/asciidoc-deps.tcl	2010-04-02 23:42:45 UTC (rev 65912)
@@ -0,0 +1,35 @@
+#!/usr/bin/env tclsh
+# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:filetype=tcl:et:sw=4:ts=4:sts=4
+
+if {[llength $::argv] == 0} {
+    puts "Usage: ${::argv0} <*.txt>"
+    exit 1
+}
+
+# Dependency storage
+array set deps {}
+
+# Gather includes
+foreach file $::argv {
+    if {![file exists $file]} {
+        continue
+    }
+    set fd [open "$file" r]
+    set cont [read $fd]
+    close $fd
+    set deplst [regexp -all -inline -- {include::([^\[]*)\[\]} $cont]
+    if {[llength $deplst] > 0} {
+        set deps($file) $deplst
+    }
+}
+
+# Output
+foreach {file deplst} [array get deps] {
+    puts -nonewline "[file rootname $file].xml [file rootname $file].html:"
+    foreach {match dep} $deplst {
+        puts -nonewline " $dep"
+    }
+    puts ""
+}
+
+exit 0


Property changes on: branches/new-help-system/base/doc/asciidoc-deps.tcl
___________________________________________________________________
Added: svn:executable
   + *
Added: svn:keywords
   + Id
Added: svn:eol-style
   + native
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20100402/b06f0915/attachment.html>


More information about the macports-changes mailing list