From: Adam Dickmeiss Date: Tue, 27 Jun 1995 17:10:36 +0000 (+0000) Subject: Bug fix: install procedure didn't work on some systems. X-Git-Tag: IRTCL.1.4~236 X-Git-Url: http://lists.indexdata.dk/?a=commitdiff_plain;h=578c2b7c38c27fa17a59d6dee9beebc34668e76f;p=ir-tcl-moved-to-github.git Bug fix: install procedure didn't work on some systems. Error turned up when clientrc.tcl was't present. --- diff --git a/Makefile.in b/Makefile.in index c021854..9abc2c3 100644 --- a/Makefile.in +++ b/Makefile.in @@ -2,7 +2,7 @@ # (c) Index Data 1995 # See the file LICENSE for details. # Sebastian Hammer, Adam Dickmeiss -# $Id: Makefile.in,v 1.10 1995-06-26 14:46:24 adam Exp $ +# $Id: Makefile.in,v 1.11 1995-06-27 17:10:36 adam Exp $ SHELL=/bin/sh # IrTcl Version @@ -69,24 +69,40 @@ libirtcl.a: $(O) $(RANLIB) libirtcl.a install: ir-tcl - for d in $(IRTCLDIR) $(IRTCLDIR)/formats $(IRTCLDIR)/bitmaps; do \ + @for d in $(IRTCLDIR) $(IRTCLDIR)/formats $(IRTCLDIR)/bitmaps; do \ if [ ! -d $$d ]; then \ echo Making $$d; \ mkdir $$d; \ chmod 755 $$d; \ fi; \ done; - $(INSTALL_PROGRAM) ir-tcl $(BINDIR) - $(INSTALL_DATA) libirtcl.a $(LIBDIR) - $(INSTALL_DATA) ir-tcl.h $(INCDIR) - if [ -f ir-tk ]; then \ - $(INSTALL_PROGRAM) ir-tk $(BINDIR); \ + @echo "Installing ir-tcl" + @$(INSTALL_PROGRAM) ir-tcl $(BINDIR) + @echo "Installing libirtcl.a" + @$(INSTALL_DATA) libirtcl.a $(LIBDIR) + @echo "Installing ir-tcl.h" + @$(INSTALL_DATA) ir-tcl.h $(INCDIR) + @if [ -f ir-tk ]; then \ + echo "Installing ir-tk"; \ + $(INSTALL_PROGRAM) ir-tk $(BINDIR); \ + echo "Installing irclient"; \ echo "#! $(BINDIR)/ir-tk -f" >head.bak; \ cat head.bak client.tcl| sed "s,^set libdir LIBDIR,set libdir $(IRTCLDIR)," >client.bak; \ $(INSTALL_PROGRAM) client.bak $(BINDIR)/irclient; \ + echo "Installing clientrc.tcl" ; \ $(INSTALL_DATA) LICENSE clientrc.tcl $(IRTCLDIR); \ - $(INSTALL_DATA) formats/*.tcl $(IRTCLDIR)/formats; \ - $(INSTALL_DATA) bitmaps/book? $(IRTCLDIR)/bitmaps; \ + echo "Installing display format scripts"; \ + for b in formats/*.tcl; do \ + if [ -f $$b ]; then \ + $(INSTALL_DATA) $$b $(IRTCLDIR)/formats; \ + fi; \ + done; \ + echo "Installing bitmaps"; \ + for b in bitmaps/*; do \ + if [ -f $$b ]; then \ + $(INSTALL_DATA) $$b $(IRTCLDIR)/bitmaps; \ + fi; \ + done; \ fi; clean: diff --git a/client.tcl b/client.tcl index d227e4c..8b7b984 100644 --- a/client.tcl +++ b/client.tcl @@ -4,7 +4,11 @@ # Sebastian Hammer, Adam Dickmeiss # # $Log: client.tcl,v $ -# Revision 1.54 1995-06-27 14:41:03 adam +# Revision 1.55 1995-06-27 17:10:37 adam +# Bug fix: install procedure didn't work on some systems. +# Error turned up when clientrc.tcl was't present. +# +# Revision 1.54 1995/06/27 14:41:03 adam # Bug fix in search-response. Didn't always observe non-surrogate diagnostics. # # Revision 1.53 1995/06/26 12:40:09 adam @@ -193,18 +197,24 @@ # set libdir LIBDIR -if {[file readable clientrc.tcl]} { +if {[file readable bitmaps/book2]} { set libdir . } +if {! [file readable ${libdir}/bitmaps/book2]} { + puts "Cannot locate system files in ${libdir}. You must either run this" + puts "program from the source directory root of ir-tcl or you must assure" + puts "that it is installed - normally in /usr/local/lib/irtcl" + exit 1 +} + set hotTargets {} set hotInfo {} set busy 0 -set profile(Default) {{} {} {210} {} 16384 8192 tcpip {} 1 {} {} Z39} +set profile(Default) {{} {} {210} {} 16384 8192 tcpip {} 1 {} {} Z39 1} set hostid Default set settingsChanged 0 set setNo 0 -set lastSetNo 0 set cancelFlag 0 set scanEnable 0 set fullMarcSeq 0 @@ -240,7 +250,7 @@ proc tkerror err { -font -Adobe-Helvetica-Bold-R-Normal-*-240-* pack $w.top.b $w.top.t -side left -padx 10 -pady 10 - bottom-buttons $w [list {Close} [list destroy $w]] 0 + bottom-buttons $w [list {Close} [list destroy $w]] 1 } proc read-formats {} { @@ -338,8 +348,12 @@ proc toplevelG {w} { bind $w [list destroyGW $w] } -if {[file readable "${libdir}/clientrc.tcl"]} { - source "${libdir}/clientrc.tcl" +if {[file readable "clientrc.tcl"]} { + source "clientrc.tcl" +} else { + if {[file readable "${libdir}/clientrc.tcl"]} { + source "${libdir}/clientrc.tcl" + } } if {[file readable "~/.clientrc.tcl"]} { @@ -843,6 +857,7 @@ proc close-target {} { show-message {} .top.target.m disable 1 .top.target.m disable 2 + .top.rset.m delete 2 last .top.target.m enable 0 } @@ -1277,13 +1292,13 @@ proc search-response {} { } return } + set setOffset 0 set delayRequest {} init-title-lines set setMax [z39.$setNo resultCount] show-status {Ready} 0 1 set status [z39.$setNo responseStatus] if {[lindex $status 0] == "NSD"} { - set setOffset 0 set code [lindex $status 1] set msg [lindex $status 2] set addinfo [lindex $status 3] @@ -1294,6 +1309,9 @@ proc search-response {} { set setMax 20 } show-message "${setMax} hits" + if {$setMax == 0} { + return + } set setOffset 1 show-status {Ready} 0 1 set l [format "%-4d %7d" $setNo $setMax] @@ -1895,7 +1913,7 @@ proc query-delete {queryNo} { label $w.top.warning -bitmap warning message $w.top.quest -text "Are you sure you want to delete the \ -query type $n ?" -aspect 200 +query type $n ?" -aspect 300 pack $w.top.warning $w.top.quest -side left -expand yes -padx 10 -pady 5 bottom-buttons $w [list {Ok} [list query-delete-action $queryNo] \ {Cancel} [list destroy $w]] 1 @@ -1960,9 +1978,15 @@ proc save-settings {} { global queryInfo if {![file writable "${libdir}/clientrc.tcl"]} { - return + set a [alert "Cannot open ${libdir}/clientrc.tcl for writing. Do you \ + wish to save clientrc.tcl in the current directory instead?"] + if {! $a} { + return + } + set f [open "clientrc.tcl" w] + } else { + set f [open "${libdir}/clientrc.tcl" w] } - set f [open "${libdir}/clientrc.tcl" w] puts $f "# Setup file" foreach n [array names profile] { @@ -1995,7 +2019,7 @@ proc alert {ask} { top-down-window $w label $w.top.warning -bitmap warning - message $w.top.message -text $ask -aspect 200 \ + message $w.top.message -text $ask -aspect 300 \ -font -Adobe-Times-Medium-R-Normal-*-180-* pack $w.top.warning $w.top.message -side left -pady 5 -padx 10 -expand yes diff --git a/clientrc.tcl b/clientrc.tcl index a5a96af..e357000 100644 --- a/clientrc.tcl +++ b/clientrc.tcl @@ -2,18 +2,19 @@ set {profile(Penn)} {{Penn State's Library} 128.118.88.200 210 {} 16384 8192 tcpip CATALOG 1 {} {} Z39 2} set {profile(ztest)} {{test server} localhost 9999 {} 16384 4096 tcpip dummy 1 {} {} Z39 3} set {profile(madison)} {{University of Wisconsin-Madison} z3950.adp.wisc.edu 210 {} 16384 8192 tcpip madison 1 {} {} Z39 22} -set {profile(Default)} {{} {} {210} {} 16384 8192 tcpip {} 1 {} {} {} 26} +set {profile(Default)} {{} {} {210} {} 16384 8192 tcpip {} 1 {} {} {} 27} set {profile(RLG)} {{Research Libraries group} rlg.stanford.edu 210 {} 4096 4096 tcpip {BKS AMC MAPS MDF REC SCO SER VIM NAF SAF AUT CATALOG ABI AVI DSA EIP FLP HAP HST NPA PAI PRA WLI} 1 {} {} Z39 5} set {profile(AT&T server)} {{AT&T Z39 Server} z3950.research.att.com 210 {} 16384 16384 tcpip Default 1 {} {} Z39 21} set {profile(LOC)} {{Library of Congress} IBM2.LOC.gov 2210 {} 16384 16384 tcpip {BOOKS NAMES} 1 {} 0 Z39 6} set {profile(DANBIB)} {{SR Target DANBIB} 0103/find2.denet.dk 4500 {} 8192 8192 mosi danbib 1 {} 1 SR 8} set {profile(OCLC)} {{OCLC First search engine} z3950.oclc.org 210 {} 16384 8192 tcpip {ArticleFirst BiographyIndex BusinessPeriodicalsIndex} 1 {} {} Z39 9} +set {profile(adad)} {a {} 210 {} 16384 8192 tcpip {} 1 {} {} Z39 26} set {profile(CARL)} {{CARL systems} Z3950.carl.org 210 {} 16384 8192 tcpip {ACC AIC AUR BEM CUB DPL DNU EPL FRC LAW LCC MCC MIN MPL NJC NWC OCC PPC PUE RDR RGU SPL TCC TKU UNC WYO} 1 {} {} Z39 11} set {profile(CLSI)} {CLSI inet-gw.clsi.us.geac.com 210 {} 16384 8192 tcpip cl_default 1 {} {} Z39 13} set {profile(Innovative)} {{Innovatives server: demo.iii.com} demo.iii.com 210 {} 16384 8192 tcpip DEFAULT 1 {} {} Z39 12} set {profile(AULS)} {{Acadia university} auls.acadiau.ca 210 {} 16384 8192 tcpip AULS 1 {} {} Z39 14} -set {profile(canberra)} {canberra canberra.cs.umass.edu 2110 {} 30000 30000 tcpip cacm_dots 1 {} {} Z39 25} set {profile(dranet)} {dranet dranet.dra.com 210 {} 16384 16384 tcpip drewdb 1 {} {} Z39 15} +set {profile(canberra)} {canberra canberra.cs.umass.edu 2110 {} 30000 30000 tcpip cacm_dots 1 {} {} Z39 25} set queryTypes {Simple phrase} set queryButtons {{ {I 0} {I 1} {I 2} } {{I 0} {I 1} {I 0}}} set queryInfo {{ {Title {1=4}} {Author {1=1}} {Subject {1=21}} {Any {1=1016}}} {{Title 1=4 4=1 6=2} {Author 1=1003 4=1 6=2} {ISBN 1=7} {ISSN 1=8} {Year 1=30 4=4 6=2} {Any {}}}}