head	1.5;
access;
symbols
	RELEASE_8_3_0:1.5
	RELEASE_9_0_0:1.5
	RELEASE_7_4_0:1.5
	RELEASE_8_2_0:1.5
	RELEASE_6_EOL:1.5
	RELEASE_8_1_0:1.5
	RELEASE_7_3_0:1.5
	RELEASE_8_0_0:1.4
	RELEASE_7_2_0:1.4
	RELEASE_7_1_0:1.4
	RELEASE_6_4_0:1.4
	RELEASE_5_EOL:1.4
	RELEASE_7_0_0:1.4
	RELEASE_6_3_0:1.4
	PRE_XORG_7:1.4
	RELEASE_4_EOL:1.3
	RELEASE_6_2_0:1.3
	RELEASE_6_1_0:1.2
	RELEASE_5_5_0:1.2
	RELEASE_6_0_0:1.2
	RELEASE_5_4_0:1.1
	RELEASE_4_11_0:1.1
	RELEASE_5_3_0:1.1
	RELEASE_4_10_0:1.1
	RELEASE_5_2_1:1.1
	RELEASE_5_2_0:1.1
	RELEASE_4_9_0:1.1
	RELEASE_5_1_0:1.1
	RELEASE_4_8_0:1.1
	old_RELEASE_5_0_0:1.1
	old_RELEASE_4_7_0:1.1
	old_RELEASE_4_6_2:1.1
	old_RELEASE_4_6_1:1.1
	old_RELEASE_4_6_0:1.1
	old_RELEASE_5_0_DP1:1.1
	old_RELEASE_4_5_0:1.1
	old_RELEASE_4_4_0:1.1
	old_RELEASE_4_3_0:1.1
	old_RELEASE_4_2_0:1.1
	old_RELEASE_4_1_1:1.1
	old_RELEASE_4_1_0:1.1;
locks; strict;
comment	@# @;


1.5
date	2009.11.30.01.47.22;	author mi;	state Exp;
branches;
next	1.4;

1.4
date	2007.03.26.17.11.37;	author thierry;	state Exp;
branches;
next	1.3;

1.3
date	2006.06.27.23.23.19;	author mi;	state Exp;
branches;
next	1.2;

1.2
date	2005.07.18.23.58.37;	author mi;	state Exp;
branches;
next	1.1;

1.1
date	2000.07.13.20.54.36;	author ade;	state Exp;
branches;
next	;


desc
@@


1.5
log
@Better handle differences in the set of help-pages.
Chase the lang/tcl85's decision to install man1/tclsh8.5.1 instead of
man1/tclsh.1 -- now, when we can't find a man-page foo, we try looking
for foo$tcl_version.

PR:	ports/140978
Submitted by:	olli hauer
@
text
@--- unix/tools/bldmanhelp.tcl	2004-12-02 15:33:05.000000000 -0500
+++ unix/tools/bldmanhelp.tcl	2009-11-28 16:41:13.000000000 -0500
@@@@ -11,10 +11,9 @@@@
 #
 # The command line is:
 #
-#   bldmanhelp docdir maninfo helpdir
+#   bldmanhelp maninfo helpdir
 #
 # Where:
-#    o docdir is the directory containing the manual pages.
 #    o maninfo is the path to a file that when sources returns a list of
 #      entries describing manual pages to convert.  Each entry is a list
 #      of manual file and the path of the help file to generate.
@@@@ -68,18 +67,41 @@@@
 
 proc CopyManPage {manPage outFH} {
     global skipSection
+    global tcl_version
 
-    set stat [catch {
-        open $manPage
-    } fh]
+    set section [lindex [split $manPage .] end]
+    if {$section == "macros"} {
+      return
+    }
+    set manPage [file rootname $manPage]
+    if {[catch {exec man -w $section $manPage} page] &&
+	[catch {exec man -w $section $manPage$tcl_version} page]} {
+        global gotErrors
+        set gotErrors 1
+	puts stderr "can't find man-page for \"$manPage\": $page"
+	return
+    }
+    set manPage [split $page ":)"]
+    if {[llength $manPage] > 1} { # Get the source, not from cat
+	set manPage [string trim [lindex $manPage 1]]
+    }
+    
+    if {[string match *.gz $manPage]} {
+	set stat [catch {open "|gzip -d -c $manPage"} fh]
+    } elseif {[string match *.bz2 $manPage]} {
+	set stat [catch {open "|bzip2 -d -c $manPage"} fh]
+    } else {
+	set stat [catch {open $manPage} fh]
+    }
     if {$stat != 0} {
         global gotErrors
         set gotErrors 1
-        puts stderr "can't open \"$manPage\" $fh"
+        puts stderr "can't open \"$manPage\" $fh. (cwd is [pwd])"
         return
     }
     while {[gets $fh line] >= 0} {
         switch -glob -- $line {
+	    {.so man.macros} {}
             .so* {
                 CopyManPage [lindex $line 1] $outFH
             }
@@@@ -119,11 +141,10 @@@@
 # for input to buildhelp.
 #
 
-proc GenInputFile {docDir manInfoTbl tmpFile} {
+proc GenInputFile {manInfoTbl tmpFile} {
 
    set tmpFH [open $tmpFile w]
    set cwd [pwd]
-   cd $docDir
 
    foreach ent $manInfoTbl {
        puts stdout "    preprocessing $ent"
@@@@ -144,13 +165,12 @@@@
 
 set tmpFile "bldmanhelp.tmp"
 
-set docDir [lindex $argv 0]
 set manInfoTbl [source [lindex $argv 1]]
 set helpDir [lindex $argv 2]
 set brief [lindex $argv 3]
 
 puts stdout "Begin preprocessing UCB manual files"
-GenInputFile $docDir $manInfoTbl $tmpFile
+GenInputFile $manInfoTbl $tmpFile
 
 buildhelp $helpDir $brief [list $tmpFile]
 
@


1.4
log
@- Fix a breakage caused by revision v 1.91 of ports/lang/tcl84/Makefile

- Switch to USE_TCL

- s/INSTALLS_SHLIB/USE_LDCONFIG/

- Support tcl84-thread

- Fix tclsh detection in configure

- Pet portlint.

Note: this port is still broken, because a test is failing, and tests
are part of the all target.

PR:		ports/110805
Submitted by:	/me
Approved by:	mi (excepted the move of tests to a regression-test target)
@
text
@d1 2
a2 2
--- ./unix/tools/bldmanhelp.tcl.orig	Thu Dec  2 21:33:05 2004
+++ ./unix/tools/bldmanhelp.tcl	Sun Mar 25 17:07:36 2007
d15 2
a16 1
@@@@ -69,17 +68,32 @@@@
d19 1
d29 8
a36 1
+    set manPage [split [exec man -w $section $manPage] ":)"]
d61 1
a61 1
@@@@ -119,11 +133,10 @@@@
d74 1
a74 1
@@@@ -144,13 +157,12 @@@@
@


1.3
log
@Upgrade tclX from 8.3.5 to 8.4 released last November after several
years of idleness. The changes are fairly substantial -- all Tk bits,
however insignificant they were, are now removed completely, for
example. No TclX enabled executable is built/installed either -- a Tcl
script is expected to load the Tclx package via the "package require
Tclx" only.

The changes to port add the handling of SIGINFO (made possible by the
recent fix-up of lang/tcl84), running the authors' test-target as part
of the build, and skipping building/installing of help files in the
NOPORTDOCS case.

The devel/tcl-neo is the only dependant port of tclX and is updated to
depend on the new version.
@
text
@d1 4
a4 3
--- unix/tools/bldmanhelp.tcl	Thu Dec  2 15:33:05 2004
+++ unix/tools/bldmanhelp.tcl	Mon Jun 26 19:51:14 2006
@@@@ -12,8 +12,7 @@@@
d14 3
a16 1
@@@@ -70,15 +69,27 @@@@
d23 3
d51 3
a53 1
@@@@ -120,9 +131,8 @@@@
d64 3
a66 1
@@@@ -145,5 +155,4 @@@@
d72 1
a72 1
@@@@ -151,5 +160,5 @@@@
d79 1
@


1.2
log
@Unbreak the manual pages installation and help file generation:

	. when parsing man-files, do not choke on files
	  containing '.so man.macros';
	. be ready for the .bz2 man-pages;
	. do not use vendor's install-doc target at all -- install
	  the vendor's manual pages in post-install and declare
	  MLINKS to have bsd.port.mk do the Right Thing (TM) --
	  links instead of copies of the manual pages.

This may even work now :-)
@
text
@d1 4
a4 3
--- tools/bldmanhelp.tcl.orig	Sun Feb  6 19:54:02 2000
+++ tools/bldmanhelp.tcl	Thu Feb 24 17:03:26 2000
@@@@ -13,6 +13,5 @@@@
d12 3
a14 1
@@@@ -64,5 +63,16 @@@@
d34 1
a34 1
@@@@ -70,3 +75,3 @@@@
d39 2
a40 1
@@@@ -75,2 +89,3 @@@@
d44 3
a46 1
@@@@ -114,3 +119,3 @@@@
d51 1
a51 1
@@@@ -118,3 +123,2 @@@@
d55 3
a57 8
@@@@ -132,4 +136,4 @@@@
 
-if {[llength $argv] != 4} {
-    puts stderr "wrong # args: bldmanhelp docdir maninfo helpdir brief"
+if {[llength $argv] != 3} {
+    puts stderr "wrong # args: bldmanhelp maninfo helpdir brief"
     exit 1
@@@@ -139,9 +143,8 @@@@
d60 3
a62 6
-set manInfoTbl [source [lindex $argv 1]]
-set helpDir [lindex $argv 2]
-set brief [lindex $argv 3]
+set manInfoTbl [source [lindex $argv 0]]
+set helpDir [lindex $argv 1]
+set brief [lindex $argv 2]
d68 1
@


1.1
log
@Import of tclX82 after repo-copy from tclX80, one more step on
the road to obliterating tcl/tk 8.0 from the tree.

Note 1: the patches have been extensively re-worked from the
        original submission, to make this port PREFIX-safe,
        and also to deal with multiple patchfiles updating the
        same source file.

Note 2: I've left the MAINTAINER as jseger.  Justin, you may
        want to cast your TCL-expert eye over this one, it seems
        to do the right thing.

PR:		16970
Submitted by:	Mikhail Teterin <mi@@aldan.algebra.com>
@
text
@d11 1
a11 1
@@@@ -64,5 +63,14 @@@@
d25 2
d36 4
@

