forked from Lainports/freebsd-ports
available code remains at 3.0. Install the data files directly -- instead of extracting them into WRKSRC first. Only install files actually used by the applications -- the distfiles also contain data, that is used to build the databases, but aren't used at runtime.
56 lines
1.6 KiB
Text
56 lines
1.6 KiB
Text
This patch makes wnb use man(1) to access its own man-pages instead
|
|
of relying on textual copies of them being in the $resourcedir.
|
|
|
|
Similarly, it looks for the compiled-in license instead of opening
|
|
its textual copy.
|
|
|
|
These leave wn.xbm as the only "resource" file, thus removing the need
|
|
for a separate resource directory. FreeBSD port installs all -- the
|
|
dictionaries and the bitmap into ${PREFIX}/share/WordNet.
|
|
|
|
-mi
|
|
|
|
--- src/wnb Tue Jun 7 15:19:22 2005
|
|
+++ src/wnb Sun Jan 15 07:42:38 2006
|
|
@@ -103,9 +100,14 @@
|
|
|
|
if {$tcl_platform(platform) == "unix"} {
|
|
- if {[lsearch -exact [array names env] WNHOME] == -1} {
|
|
- set resourcedir "/usr/local/WordNet-3.0/lib/wnres"
|
|
- } else {
|
|
- set resourcedir "$env(WNHOME)/lib/wnres"
|
|
+ set resourcedirs {
|
|
+ /usr/local/WordNet
|
|
+ }
|
|
+ if {[info exists env(WNHOME)]} {
|
|
+ lappend resourcedirs $env(WNHOME) $env(WNHOME)/lib/wnres
|
|
}
|
|
+ foreach resourcedir $resourcedirs {
|
|
+ if {[file exists $resourcedir/wn.xbm]} break
|
|
+ }
|
|
+ unset resourcedirs
|
|
set configfile "$env(HOME)/.wnrc"
|
|
if [ file exists $configfile ] {
|
|
@@ -575,7 +578,19 @@
|
|
.$w.top.text configure \
|
|
-state normal
|
|
- set fileid [open $filename "r"]
|
|
- set filetext [read $fileid]
|
|
- close $fileid
|
|
+ switch -glob -- $filename {
|
|
+ *.man {
|
|
+ set manpage [file tail $filename]
|
|
+ set manpage [string range $manpage 0 end-4]
|
|
+ set fileid [open "|man $manpage"]
|
|
+ } */license.txt {
|
|
+ set filetext [wnlicense]
|
|
+ } default {
|
|
+ set fileid [open $filename]
|
|
+ }
|
|
+ }
|
|
+ if {[info exists fileid]} {
|
|
+ set filetext [read $fileid]
|
|
+ close $fileid
|
|
+ }
|
|
regsub -all ".\b" $filetext "" filetext
|
|
.$w.top.text insert end $filetext
|