Debian Codegraph @

texk/gregorio/gregorio-src/contrib/system-setup.command

raw
1 #!/usr/bin/env bash
2
3 # This script generates a log detailing information about your computer.
4 # You can run it by double clicking on it on a Mac.
5 # On Linux this behavior is controlled by a preference. See http://askubuntu.com/questions/286621/how-do-i-run-executable-scripts-in-nautilus for details.
6 # If prompted, you need to select "Run in Terminal" to see the output.
7
8 #This trap combination allows the window to linger long enough for the user to
9 #inspect the output, but still get closed when all is said and done.
10 function quit {
11 read -n1 -r -p "Press any key to close window." key
12 if $mac; then
13 osascript -e 'tell application "Terminal" to close front window' > /dev/null 2>&1 &
14 else
15 exit
16 fi
17 }
18
19 trap quit EXIT
20
21 case "$(uname -s)" in
22 Darwin)
23 echo 'Mac OS X detected'
24 mac=true
25 ;;
26 Linux)
27 echo 'Linux detected'
28 mac=false
29 ;;
30 *)
31 echo 'Unsupported OS detected'
32 exit 1
33 ;;
34 esac
35
36
37 HERE="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
38 OUTPUT=$HERE/system-setup.log
39
40 echo "Gregorio Unix Setup Diagnostic Tool"
41 echo "(C) 2015 The Gregorio Project."
42 echo ""
43 echo "Gregorio is free software: you can redistribute it and/or modify"
44 echo "it under the terms of the GNU General Public License as published by"
45 echo "the Free Software Foundation, either version 3 of the License, or"
46 echo "(at your option) any later version."
47 echo ""
48 echo "This program is distributed in the hope that it will be useful,"
49 echo "but WITHOUT ANY WARRANTY; without even the implied warranty of"
50 echo "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the"
51 echo "GNU General Public License for more details."
52 echo ""
53 echo "You should have received a copy of the GNU General Public License"
54 echo "along with this program. If not, see http://www.gnu.org/licenses/."
55 echo ""
56 echo "Creating system-setup.log..."
57
58 echo "### Gregorio Unix Setup Results" > $OUTPUT
59 echo "#### Created: `date`" >> $OUTPUT
60 echo "-----------------------------------------------------------------------------" >> $OUTPUT
61 echo "" >> $OUTPUT
62 echo "" >> $OUTPUT
63
64 echo "### OS Version" >> $OUTPUT
65 uname -v >> $OUTPUT
66 echo "" >> $OUTPUT
67 echo "" >> $OUTPUT
68 echo "-----------------------------------------------------------------------------" >> $OUTPUT
69 echo "" >> $OUTPUT
70 echo "" >> $OUTPUT
71
72 echo "### LuaTeX Setup" >> $OUTPUT
73 echo "#### Version" >> $OUTPUT
74 echo "" >> $OUTPUT
75 luatex -v >> $OUTPUT 2>&1
76 echo "" >> $OUTPUT
77 echo "#### Location" >> $OUTPUT
78 echo "" >> $OUTPUT
79 which -a luatex >> $OUTPUT 2>&1
80 echo "" >> $OUTPUT
81 echo "" >> $OUTPUT
82 echo "#### TEXMFLOCAL" >> $OUTPUT
83 echo "" >> $OUTPUT
84 kpsewhich --var-value TEXMFLOCAL >> $OUTPUT 2>&1
85 echo "" >> $OUTPUT
86 echo "#### TEXINPUTS.lualatex" >> $OUTPUT
87 kpsewhich --var-value=TEXINPUTS.lualatex >> $OUTPUT 2>&1
88 echo "" >> $OUTPUT
89 echo "#### LUAINPUTS.lualatex" >> $OUTPUT
90 kpsewhich --var-value=LUAINPUTS.lualatex >> $OUTPUT 2>&1
91 echo "" >> $OUTPUT
92 echo "#### shell_escape" >> $OUTPUT
93 kpsewhich --var-value=shell_escape >> $OUTPUT 2>&1
94 echo "" >> $OUTPUT
95 echo "#### Shell Escape Commands" >> $OUTPUT
96 kpsewhich --var-value=shell_escape_commands >> $OUTPUT 2>&1
97 echo "" >> $OUTPUT
98 echo "#### openout_any" >> $OUTPUT
99 kpsewhich --var-value=openout_any >> $OUTPUT 2>&1
100 echo "" >> $OUTPUT
101 echo "#### openin_any" >> $OUTPUT
102 kpsewhich --var-value=openin_any >> $OUTPUT 2>&1
103 echo "" >> $OUTPUT
104 echo "" >> $OUTPUT
105 echo "-----------------------------------------------------------------------------" >> $OUTPUT
106 echo "" >> $OUTPUT
107 echo "" >> $OUTPUT
108
109 echo "### Gregorio Setup" >> $OUTPUT
110 echo "#### Locations and Versions" >> $OUTPUT
111 echo "" >> $OUTPUT
112 progs=`compgen -cbka -A function 'gregorio'`
113 for prog in $progs; do
114 which -a $prog >> $OUTPUT 2>&1
115 $prog -V >> $OUTPUT 2>&1
116 echo "" >> $OUTPUT
117 done
118 echo "#### GregorioTeX Locations" >> $OUTPUT
119 echo "" >> $OUTPUT
120
121 # Files using GREGORIO_VERSION
122 files="gregoriosyms.sty
123 gregoriotex-chars.tex
124 gregoriotex-main.tex
125 gregoriotex-nabc.lua
126 gregoriotex-nabc.tex
127 gregoriotex-signs.lua
128 gregoriotex-signs.tex
129 gregoriotex-spaces.tex
130 gregoriotex-syllable.tex
131 gregoriotex-symbols.lua
132 gregoriotex-symbols.tex
133 gregoriotex-common.tex
134 gregoriotex-gsp-default.tex
135 gregoriotex.lua"
136
137 for f in $files
138 do
139 echo "##### $f" >> $OUTPUT
140 locations=`kpsewhich -all $f`
141 for loc in $locations; do
142 echo $loc >> $OUTPUT 2>&1
143 grep -m 1 'GREGORIO_VERSION' $loc | grep -o '[0-9]*\.[0-9]*\.[0-9]*-*[betarc]*[0-9]*' >> $OUTPUT 2>&1
144 done
145 done
146
147 # Files using PARSE_VERSION_DATE_LTX
148 files="gregoriotex.sty
149 gregoriotex.tex"
150
151 for f in $files
152 do
153 echo "##### $f" >> $OUTPUT
154 locations=`kpsewhich -all $f`
155 for loc in $locations; do
156 echo $loc >> $OUTPUT 2>&1
157 grep -m 1 'PARSE_VERSION_DATE_LTX' $loc | grep -o '[0-9]*\.[0-9]*\.[0-9]*-*[betarc]*[0-9]*' >> $OUTPUT 2>&1
158 done
159 done
160
161 # Font Files
162 files="greciliae.ttf
163 greciliae-hollow.ttf
164 greciliae-hole.ttf
165 greciliae-op.ttf
166 greciliae-op-hollow.ttf
167 greciliae-op-hole.ttf
168 greextra.ttf
169 gregorio.ttf
170 gregorio-hollow.ttf
171 gregorio-hole.ttf
172 gregorio-op.ttf
173 gregorio-op-hollow.ttf
174 gregorio-op-hole.ttf
175 granapadano.ttf
176 granapadano-hollow.ttf
177 granapadano-hole.ttf
178 granapadano-op.ttf
179 granapadano-op-hollow.ttf
180 granapadano-op-hole.ttf
181 gregall.ttf"
182
183 for f in $files
184 do
185 echo "##### $f" >> $OUTPUT
186 locations=`kpsewhich -all $f`
187 for loc in $locations; do
188 echo $loc >> $OUTPUT 2>&1
189 otfinfo --font-version $loc >> $OUTPUT 2>&1
190 done
191 done
192
193 # Unversioned and Obsolete Files
194 files="gregorio-vowels.dat
195 gsp-default.tex
196 gregoriotex-ictus.tex
197 gresym.ttf
198 parmesan.ttf
199 parmesan-op.ttf
200 gregsmodern.ttf"
201
202 for f in $files
203 do
204 echo "##### $f" >> $OUTPUT
205 kpsewhich -all $f >> $OUTPUT 2>&1
206 done
207
208
209 echo "" >> $OUTPUT
210 echo "### LuaTeX Double Checks" >> $OUTPUT
211 echo "#### kpsewhich --all -engine luatex -progname lualatex gregoriotex.sty" >> $OUTPUT
212 kpsewhich --all -engine luatex -progname lualatex gregoriotex.sty >> $OUTPUT 2>&1
213 echo "" >> $OUTPUT
214 echo "#### kpsewhich --all -engine luatex gregoriotex.tex" >> $OUTPUT
215 kpsewhich --all -engine luatex gregoriotex.tex >> $OUTPUT 2>&1
216 echo "" >> $OUTPUT
217 echo "" >> $OUTPUT
218 echo "-----------------------------------------------------------------------------" >> $OUTPUT
219 echo "" >> $OUTPUT
220 echo "" >> $OUTPUT
221
222 echo ""
223 echo ""
224 echo "system-setup.log created and saved the working directory from which you"
225 echo "ran this script. Please email it to [email protected] as"
226 echo "part of your bug report."
227 echo ""
228 echo "You can also create an issue at "
229 echo "http://github.com/gregorio-project/gregorio/issues"
230 echo "and copy-paste the content of this file into the description."
231 echo ""
232 exit 0
233