source: trunk/mkdictindex.tcl @ 768

Last change on this file since 768 was 768, checked in by toby, 11 years ago

# on 2004/01/12 21:52:23, toby did:
a routine to create an index for each CIF dictionary

  • Property rcs:author set to toby
  • Property rcs:date set to 2004/01/12 21:52:23
  • Property rcs:rev set to 1.1
  • Property rcs:state set to Exp
  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Revision Id
File size: 1.5 KB
Line 
1#!/bin/sh
2# the next line restarts this script using wish found in the path\
3exec wish "$0" "$@"
4# If this does not work, change the #!/usr/bin/wish line below
5# to reflect the actual wish location and delete all preceeding lines
6#
7# (delete here and above)
8#------------------------------------------------------------------------------
9#------------------------------------------------------------------------------
10# load the CIF dictionaries; this forces the creation of dictionary index files
11#------------------------------------------------------------------------------
12#------------------------------------------------------------------------------
13
14# where is this file running from?
15set script [info script]
16# translate links -- go six levels deep
17foreach i {1 2 3 4 5 6} {
18    if {[file type $script] == "link"} {
19        set link [file readlink $script]
20        if { [file  pathtype  $link] == "absolute" } {
21            set script $link
22        } {
23            set script [file dirname $script]/$link
24        }
25    } else {
26        break
27    }
28}
29# fixup relative paths
30if {[file pathtype $script] == "relative"} {
31    set script [file join [pwd] $script]
32}
33set scriptdir [file dirname $script ]
34
35source [file join $scriptdir browsecif.tcl]
36
37# define a list of dictionary files
38set dictfilelist [glob -nocomplain \
39                      [file join [file dirname $scriptdir] data *.dic]]
40set CIF(dictfilelist) {}
41foreach f $dictfilelist {
42    lappend ::CIF(dictfilelist) $f
43    set ::CIF(dict_$f) 1
44}
45# load the initial CIF dictionaries
46LoadDictIndices
47
48exit
Note: See TracBrowser for help on using the repository browser.