File: vflmkfdb

package info (click to toggle)
vflib3 3.6.14.dfsg-3+nmu3
  • links: PTS
  • area: main
  • in suites: stretch
  • size: 11,536 kB
  • ctags: 3,710
  • sloc: ansic: 35,811; sh: 10,357; asm: 3,290; makefile: 962; lisp: 123; perl: 109; awk: 43
file content (108 lines) | stat: -rwxr-xr-x 2,880 bytes parent folder | download | duplicates (9)
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
#!/bin/sh
#
# vflmkfdb  --- Make a database for VFlib font file path
# 
# Copyright (C) 1998,1999  Hirotsugu Kakugawa. 
# All rights reserved.
# 
# This file is part of the VFlib Library.  This library is free
# software; you can redistribute it and/or modify it under the terms of
# the GNU Library General Public License as published by the Free
# Software Foundation; either version 2 of the License, or (at your
# option) any later version.  This library is distributed in the hope
# that it will be useful, but WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE.  See the GNU Library General Public License for more details.
# You should have received a copy of the GNU Library General Public
# License along with this library; if not, write to the Free Software
# Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.


DBFILE="VFlib.fdb"
DBFILE_BAK="VFlib.fdb.bak"

FIND_OPT_ARG=
TARGETS=
STDOUT="NO"

for arg in $* 
do
  case ${arg} in
  -h|--help)
     echo "vflmkfdb --- make a VFlib font path hint database"  >&2
     echo "Usage: vflmkfdb [options] [dir ...]"  >&2
     echo "Options: "  >&2
     echo "  -s   Follow symbolic links"  >&2
     echo "  -z   Hints are printed to standard output, not to a file"  >&2
     echo "  -h   Help"  >&2
     exit
     ;;
  -s)
     FIND_OPT_ARG="-L"
     ;;
  -z)
     STDOUT="YES"
     ;;
  -*)
     echo "vflmkdb: Unknown option: ${arg}"  >&2    
     echo "Use -h option for help."  >&2    
     exit
     ;;
  *)
     TARGETS="${TARGETS} ${arg}"
     ;;
  esac
done


if test "X-${TARGETS}" = "X-" ; then
  if test "X-${PWD:-unset}" != "X-unset" ; then
    TARGETS=${PWD}
  else
    TARGETS="." 
  fi
fi

if test ${STDOUT} = "NO" ; then
  OUTPUT="${DBFILE}"
else
  OUTPUT="/dev/tty"
fi

for t in ${TARGETS}
do
  t=`echo ${t} | sed 's|^\(.*[^/]\)/*$|\1|'`
  echo Making ${t}/${DBFILE}...
  cd ${t}
  if test ${STDOUT} = "NO" -a -f ${DBFILE} ; then
    if test -f ${DBFILE_BAK} ; then
      rm -f ${DBFILE_BAK}
    fi
    mv ${DBFILE} ${DBFILE_BAK}
  fi
  find ${FIND_OPT_ARG} -d . -type f -print \
    | ( while read F; do  \
          B=`basename $F`;
          P=`echo $F | sed 's|^\./||'`;
          case $B
          in
          ${DBFILE}|${DBFILE_BAK}|fonts.dir|fonts.alias|\
          *\.tar|*\.tar\.*|*\.zip|*\.lzh|\
	  *\.txt|*\.TXT|*\.doc|*\.DOC|\
	  *\.ps|*\.ps\.*|*\.eps|*\.eps\.*|*\.pdf|*\.pdf\.*|*\.dvi|*\.dvi\.*|\
	  *\.html|*\.HTML|*\.shtml|*\.SHTML|*\.htm|*\.HTM|\
	  *\.gif|*\.GIF|*\.jpg|*\.JPG|*\.tiff|*\.TIFF|\
	  *\.exe|*\.EXE|*\.com|*\.COM|\
          Makefile*|makefile*|Imakefile*|*README*|*Readme*|*readme*|\
          *\.c|*\.h|*\.sh|*\.log|*\.LOG|\
          *~|*\.bak|core|*\.core)
            continue
            ;;
          esac
          echo "$B	$P"; \
        done )   \
    | sort \
    > ${OUTPUT}
done

#EOF