/usr/share/xcrysden/Tcl/check_package.tcl is in xcrysden-data 1.5.60-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 | #############################################################################
# Author: #
# ------ #
# Anton Kokalj Email: Tone.Kokalj@ijs.si #
# Department of Physical and Organic Chemistry Phone: x 386 1 477 3523 #
# Jozef Stefan Institute Fax: x 386 1 477 3811 #
# Jamova 39, SI-1000 Ljubljana #
# SLOVENIA #
# #
# Source: $XCRYSDEN_TOPDIR/Tcl/check_package.tcl
# ------ #
# Copyright (c) 1996--2014 by Anton Kokalj #
#############################################################################
proc check_package_awk {} {
global system
if { ![info exists system(awk)] } {
# check first for GNU awk
set system(awk) [auto_execok gawk]
if { $system(awk) == "" } {
set system(awk) [auto_execok awk]
if { $system(awk) == "" } {
WarningDialog "couldn't find \"awk\" program" "some features will not work !!!"
}
}
}
}
proc check_package_terminal {} {
global system env
if { ! [info exists system(term)] } {
# check for env(TERM)
if { [info exists env(TERM)] } {
if { $env(TERM) != "dump" } {
set system(term) [auto_execok $env(TERM)]
if { $system(term) != "" } {
return
}
}
}
# now we check for these:
foreach term {xterm xvt rxvt eterm gnome-teminal konsole roxterm} {
set system(term) [auto_execok $term]
if { $system(term) != "" } {
break
}
}
}
}
proc check_package_crystal {} {
global system
if { $system(c95_exist) } {
if { [info exists system(c95_crystal)] } {
set system(c95_integrals) $system(c95_crystal)
}
#
# CRYSTAL-95/98/03/06/09/14
#
set crystal_module $system(c95_integrals)
set input "test\nMOLECULE\n1\n1\n1 0.0 0.0 0.0\nSTOP\nEND"
WriteFile xc_inp.$system(PID) $input w
set system(c95_integrals) [auto_execok $system(c95_integrals)]
set OK 1
if { ! [file exists $system(c95_integrals)] } {
set OK 0
ErrorDialog "File \"$crystal_module\" does not exists";
}
if { $OK && ! [file executable $system(c95_integrals)] } {
set OK 0
ErrorDialog "File \"$crystal_module\" is not executable";
}
if { $OK } {
set _status [catch {
exec $system(c95_integrals) < xc_inp.$system(PID) >& xc_tmp.$system(PID)
} _errMsg]
if { $_status } {
ErrorDialog \
"Couldn't run CRYSTAL package.\n\nError Message: $_errMsg"
set system(c95_version) none
}
if { [file exists xc_tmp.$system(PID)] } {
set file [ReadFile xc_tmp.$system(PID)]
foreach line [split $file \n] {
switch -glob -- $line {
"*C R Y S T A L*" {
set vf [expr [llength $line] - 2]
set system(c95_version) [lindex $line $vf]
break
}
"* CRYSTAL03 *" {
set system(c95_version) "03"
break
}
"* CRYSTAL06 *" {
set system(c95_version) "06"
break
}
"* CRYSTAL09 *" {
set system(c95_version) "09"
break
}
"* CRYSTAL14 *" {
set system(c95_version) "14"
break
}
}
}
}
if { ! [info exists system(c95_version)] } {
set system(c95_version) "unknown -- version not recognized"
}
puts stderr "Package CRYSTAL: $system(c95_integrals) (version: $system(c95_version))"
if { ! [info exists system(c95_scf)] } {
set system(c95_scf) $system(c95_integrals)
}
} else {
# !!! OK == 0 !!!
set system(c95_exist) 0
set system(c95_version) none
}
} else {
set system(c95_version) none
}
}
|