| 1 |
#!/bin/sh |
| 2 |
# This script is used to find the xxdate.exe file needed by Hevea. |
| 3 |
# It is needed because different distributions store it in different places: |
| 4 |
# For Gentoo: /usr/lib64/hevea |
| 5 |
# For Ubuntu family: /usr/share/hevea |
| 6 |
# Etc. |
| 7 |
|
| 8 |
# If the file is found, its absolute path is printed to stdout. |
| 9 |
# Otherwise, a warning is printed on stderr and the script returns 1 |
| 10 |
|
| 11 |
file=xxdate.exe |
| 12 |
directories="$(opam var hevea:lib 2>/dev/null) /usr/lib64/hevea /usr/share/hevea /usr/local/lib/hevea /opt/local/share/hevea" |
| 13 |
|
| 14 |
for dir in ${directories}; do |
| 15 |
fullpath=${dir}/${file}; |
| 16 |
if [ -f ${fullpath} ]; then echo ${fullpath}; exit; fi |
| 17 |
done |
| 18 |
|
| 19 |
echo "*** Hevea: Unable to find xxdate.exe ***" >&2 |
| 20 |
exit 1 |